Skip to content

Commit 165b764

Browse files
Yang YingliangJassiBrar
authored andcommitted
mailbox: arm_mhuv2: Fix return value check in mhuv2_probe()
If devm_of_iomap() fails, it returns ERR_PTR() and never return NULL, so replace NULL pointer check with IS_ERR() to fix this problem. Fixes: 5a6338c ("mailbox: arm_mhuv2: Add driver") Signed-off-by: Yang Yingliang <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent f2b53c2 commit 165b764

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mailbox/arm_mhuv2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,8 @@ static int mhuv2_probe(struct amba_device *adev, const struct amba_id *id)
10621062
int ret = -EINVAL;
10631063

10641064
reg = devm_of_iomap(dev, dev->of_node, 0, NULL);
1065-
if (!reg)
1066-
return -ENOMEM;
1065+
if (IS_ERR(reg))
1066+
return PTR_ERR(reg);
10671067

10681068
mhu = devm_kzalloc(dev, sizeof(*mhu), GFP_KERNEL);
10691069
if (!mhu)

0 commit comments

Comments
 (0)