Skip to content

Commit

Permalink
crypto: atmel - fix checks of error code returned by devm_ioremap_res…
Browse files Browse the repository at this point in the history
…ource()

[ Upstream commit 9b52d55 ]

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 <vz@mleia.com>
Fixes: b0e8b34 ("crypto: atmel - use devm_xxx() managed function")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
  • Loading branch information
Cyrille Pitchen authored and Sasha Levin committed Apr 18, 2016
1 parent 9cd4622 commit a9e524e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/crypto/atmel-sha.c
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit a9e524e

Please sign in to comment.