summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/qcom_nandc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/qcom_nandc.c')
-rw-r--r--drivers/mtd/nand/qcom_nandc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c
index 245d0f39e0aa..6be555806eca 100644
--- a/drivers/mtd/nand/qcom_nandc.c
+++ b/drivers/mtd/nand/qcom_nandc.c
@@ -2639,6 +2639,9 @@ static int qcom_nand_host_init(struct qcom_nand_controller *nandc,
nand_set_flash_node(chip, dn);
mtd->name = devm_kasprintf(dev, GFP_KERNEL, "qcom_nand.%d", host->cs);
+ if (!mtd->name)
+ return -ENOMEM;
+
mtd->owner = THIS_MODULE;
mtd->dev.parent = dev;
OpenPOWER on IntegriCloud