From: Cyrille Pitchen Date: Fri, 5 Feb 2016 12:45:12 +0000 (+0100) Subject: crypto: atmel - fix checks of error code returned by devm_ioremap_resource() X-Git-Tag: v4.1.12-92~150^2~17 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=92676cb0ed2d3014fd30b097c72aee6257a6d762;p=users%2Fjedix%2Flinux-maple.git crypto: atmel - fix checks of error code returned by devm_ioremap_resource() Orabug: stable_rc4 [ Upstream commit 9b52d55f4f0e2bb9a34abbcf99e05e17f1b3b281 ] The change fixes potential oops while accessing iomem on invalid address, if devm_ioremap_resource() fails due to some reason. The devm_ioremap_resource() function returns ERR_PTR() and never returns NULL, which makes useless a following check for NULL. Signed-off-by: Vladimir Zapolskiy Fixes: b0e8b3417a62 ("crypto: atmel - use devm_xxx() managed function") Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin (cherry picked from commit a9e524e20d53b67328c1ba0301c19efae260a0a0) Signed-off-by: Dan Duval --- diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index a71c97c03c39..3178f84d2757 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -1492,13 +1492,6 @@ static int atmel_sha_remove(struct platform_device *pdev) clk_unprepare(sha_dd->iclk); - iounmap(sha_dd->io_base); - - clk_put(sha_dd->iclk); - - if (sha_dd->irq >= 0) - free_irq(sha_dd->irq, sha_dd); - return 0; }