mtd: rawnand: meson: check return value of devm_kasprintf()
authorYi Yang <yiyang13@huawei.com>
Thu, 19 Oct 2023 06:55:48 +0000 (06:55 +0000)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 27 Oct 2023 17:43:20 +0000 (19:43 +0200)
commit5a985960a4dd041c21dbe9956958c1633d2da706
treef458358c3eeeece63bf19cccffbd39ea1be7fa2a
parent74ac5b5e2375f1e8ef797ac7770887e9969f2516
mtd: rawnand: meson: check return value of devm_kasprintf()

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: 1e4d3ba66888 ("mtd: rawnand: meson: fix the clock")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20231019065548.318443-1-yiyang13@huawei.com
drivers/mtd/nand/raw/meson_nand.c