From: Fabio Estevam Date: Fri, 14 Feb 2014 03:04:44 +0000 (-0200) Subject: crypto: mxs-dcp - Fix platform_get_irq() error handling X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d9588f874482c0163caf19c2acbe5ce6260d42bf;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git crypto: mxs-dcp - Fix platform_get_irq() error handling We should test the error case for each platform_get_irq() assignment and propagate the error accordingly. Signed-off-by: Fabio Estevam Acked-by: Marek Vasut Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c index 37e070670702..08761d61d4f5 100644 --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c @@ -908,9 +908,14 @@ static int mxs_dcp_probe(struct platform_device *pdev) iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); dcp_vmi_irq = platform_get_irq(pdev, 0); + if (dcp_vmi_irq < 0) { + ret = dcp_vmi_irq; + goto err_mutex; + } + dcp_irq = platform_get_irq(pdev, 1); - if (dcp_vmi_irq < 0 || dcp_irq < 0) { - ret = -EINVAL; + if (dcp_irq < 0) { + ret = dcp_irq; goto err_mutex; }