]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mtd: concat: Use kmemdup_array instead of kmemdup for multiple allocation
authorYan Zhen <yanzhen@vivo.com>
Fri, 23 Aug 2024 11:08:24 +0000 (19:08 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 23 Aug 2024 17:25:51 +0000 (19:25 +0200)
commit175086cf4acdf4ccd3d7a6bb5c5231ececd6656b
tree55d44283b9dbab79a433eff78a0d69435a911d46
parente334c01df28225139cc831e4871c590a7851b4fc
mtd: concat: Use kmemdup_array instead of kmemdup for multiple allocation

When we are allocating an array, using kmemdup_array() to take care about
multiplication and possible overflows.

Also it makes auditing the code easier.

Signed-off-by: Yan Zhen <yanzhen@vivo.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20240823110824.3895787-1-yanzhen@vivo.com
drivers/mtd/mtdconcat.c