mtd: rawnand: intel: fix possible null-ptr-deref in ebu_nand_probe()
[linux-2.6-microblaze.git] / drivers / mtd / nand / raw / intel-nand-controller.c
index 7c1c80d..e91b879 100644 (file)
@@ -619,9 +619,9 @@ static int ebu_nand_probe(struct platform_device *pdev)
        resname = devm_kasprintf(dev, GFP_KERNEL, "nand_cs%d", cs);
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, resname);
        ebu_host->cs[cs].chipaddr = devm_ioremap_resource(dev, res);
-       ebu_host->cs[cs].nand_pa = res->start;
        if (IS_ERR(ebu_host->cs[cs].chipaddr))
                return PTR_ERR(ebu_host->cs[cs].chipaddr);
+       ebu_host->cs[cs].nand_pa = res->start;
 
        ebu_host->clk = devm_clk_get(dev, NULL);
        if (IS_ERR(ebu_host->clk))