Commit 5d8a4bd6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pstore updates from Kees Cook:

 - pstore/blk: trivial typo fixes (Eugen Hristev)

 - pstore/zone: reject zero-sized allocations (Eugen Hristev)

* tag 'pstore-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore/zone: avoid dereferencing zero sized ptr after init zones
  pstore/blk: trivial typo fixes
parents fadc3ed9 067cdf02
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ static struct pstore_device_info *pstore_device_info;
		_##name_ = check_size(name, alignsize);		\
	else							\
		_##name_ = 0;					\
	/* Synchronize module parameters with resuls. */	\
	/* Synchronize module parameters with results. */	\
	name = _##name_ / 1024;					\
	dev->zone.name = _##name_;				\
}
@@ -121,7 +121,7 @@ static int __register_pstore_device(struct pstore_device_info *dev)
	if (pstore_device_info)
		return -EBUSY;

	/* zero means not limit on which backends to attempt to store. */
	/* zero means no limit on which backends attempt to store. */
	if (!dev->flags)
		dev->flags = UINT_MAX;

+5 −0
Original line number Diff line number Diff line
@@ -1212,6 +1212,11 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
	}

	c = total_size / record_size;
	if (unlikely(!c)) {
		pr_err("zone %s total_size too small\n", name);
		return ERR_PTR(-EINVAL);
	}

	zones = kcalloc(c, sizeof(*zones), GFP_KERNEL);
	if (!zones) {
		pr_err("allocate for zones %s failed\n", name);