]> git.hungrycats.org Git - linux/commit
mtd: rawnand: intel: check return value of devm_kasprintf()
authorYi Yang <yiyang13@huawei.com>
Thu, 19 Oct 2023 06:55:37 +0000 (06:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:14:52 +0000 (17:14 +0000)
commit6fc0bc01eef1b377eda67152acc40447d535934f
treef75c3013df1b8a7bc20661f2a53f22e6997f3a54
parent0b8fb1758ef6723687cc45e4ba7017a586969be3
mtd: rawnand: intel: check return value of devm_kasprintf()

[ Upstream commit 74ac5b5e2375f1e8ef797ac7770887e9969f2516 ]

devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure. Ensure the allocation was successful by
checking the pointer validity.

Fixes: 0b1039f016e8 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20231019065537.318391-1-yiyang13@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/intel-nand-controller.c