diff options
author | Sun Ke | 2022-08-30 11:13:47 +0800 |
---|---|---|
committer | Herbert Xu | 2022-09-09 16:18:32 +0800 |
commit | dc377e013bec20dfedaec5d1f6327e4d57da359b (patch) | |
tree | 6d4b534380f6ada0eaf237947b7238ce49daa156 /drivers/crypto/aspeed | |
parent | efc96d43ec38381dacbd51679c2d01438511371d (diff) |
crypto: aspeed - fix return value check in aspeed_hace_probe()
In case of error, the function devm_ioremap_resource() returns
ERR_PTR() not NULL. The NULL test in the return value check must be
replaced with IS_ERR().
Fixes: 108713a713c7 ("crypto: aspeed - Add HACE hash driver")
Signed-off-by: Sun Ke <sunke32@huawei.com>
Reviewed-by: Neal Liu<neal_liu@aspeedtech.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/aspeed')
-rw-r--r-- | drivers/crypto/aspeed/aspeed-hace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c index 4fefc9e69d72..3f880aafb6a2 100644 --- a/drivers/crypto/aspeed/aspeed-hace.c +++ b/drivers/crypto/aspeed/aspeed-hace.c @@ -123,9 +123,9 @@ static int aspeed_hace_probe(struct platform_device *pdev) platform_set_drvdata(pdev, hace_dev); hace_dev->regs = devm_ioremap_resource(&pdev->dev, res); - if (!hace_dev->regs) { + if (IS_ERR(hace_dev->regs)) { dev_err(&pdev->dev, "Failed to map resources\n"); - return -ENOMEM; + return PTR_ERR(hace_dev->regs); } /* Get irq number and register it */ |