OSDN Git Service

mtd: rawnand: meson: add missing ENOMEM check in meson_nfc_read_buf()
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Mon, 18 Mar 2019 20:47:21 +0000 (21:47 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 21 Mar 2019 15:48:57 +0000 (16:48 +0100)
commit91e9dd7720848fc0bd1c0a96d4dd0b169d8e542a
treed960ab3b08fbede59422737f59ee3f990a1afa5e
parentb849f8b59c682c2f3c55e14224d6d4d5360fc605
mtd: rawnand: meson: add missing ENOMEM check in meson_nfc_read_buf()

kzalloc() can return NULL if memory could not be allocated. Check the
return value of the kzalloc() call in meson_nfc_read_buf() to make it
consistent with other memory allocations within the meson_nand driver.

Fixes: 8fae856c53500a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Liang Yang <liang.yang@amlogic.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/meson_nand.c