]> www.infradead.org Git - users/jedix/linux-maple.git/commit
regmap: cache: mapple: use kmalloc_array() to replace kmalloc()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 21 Nov 2024 12:34:33 +0000 (14:34 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 2 Dec 2024 00:31:15 +0000 (00:31 +0000)
commit37c95f022a7a34823c123eeccdfe415b88562867
treeb23bf95386d6f7e34adb7da22a830fa10965dbe2
parent40384c840ea1944d7c5a392e8975ed088ecf0b37
regmap: cache: mapple: use kmalloc_array() to replace kmalloc()

Use kmalloc_array() to replace kmalloc() with multiplication.
kmalloc_array() has multiply overflow check, which will be safer.
In once case change kcalloc() as we don't need to clear the memory
since it's all being reinitialised just immediately after that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241121123433.4180133-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regcache-maple.c