Commit a9e524e2 authored by Cyrille Pitchen's avatar Cyrille Pitchen Committed by Sasha Levin

crypto: atmel - fix checks of error code returned by devm_ioremap_resource()

[ Upstream commit 9b52d55f ]

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: default avatarVladimir Zapolskiy <vz@mleia.com>
Fixes: b0e8b341 ("crypto: atmel - use devm_xxx() managed function")
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 9cd46222
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment