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: 108713a713 ("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>
This commit is contained in:
Sun Ke 2022-08-30 11:13:47 +08:00 committed by Herbert Xu
parent efc96d43ec
commit dc377e013b
1 changed files with 2 additions and 2 deletions

View File

@ -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 */