From: Ezequiel Garcia Date: Wed, 17 Apr 2013 16:38:13 +0000 (-0300) Subject: mtd: nand: pxa3xx: Check for clk_prepare_enable() return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f8eaff2aa75f8ec662e044deecdc91abc780d60;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mtd: nand: pxa3xx: Check for clk_prepare_enable() return value clk_prepare_enable() can fail due to unknown reason. Add a check for this and return the error code if it fails. Signed-off-by: Ezequiel Garcia Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 1c03f9c73f8d..0f820caaa893 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1072,7 +1072,9 @@ static int alloc_nand_resource(struct platform_device *pdev) dev_err(&pdev->dev, "failed to get nand clock\n"); return PTR_ERR(info->clk); } - clk_prepare_enable(info->clk); + ret = clk_prepare_enable(info->clk); + if (ret < 0) + return ret; /* * This is a dirty hack to make this driver work from devicetree