Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mailbox: th1520: Fix a NULL vs IS_ERR() bug

The devm_ioremap() function doesn't return error pointers, it returns
NULL. Update the error checking to match.

Fixes: 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>

authored by

Dan Carpenter and committed by
Jassi Brar
d0f98e14 5bc55a33

+3 -1
+3 -1
drivers/mailbox/mailbox-th1520.c
··· 387 387 388 388 mapped = devm_ioremap(&pdev->dev, res->start + offset, 389 389 resource_size(res) - offset); 390 - if (IS_ERR(mapped)) 390 + if (!mapped) { 391 391 dev_err(&pdev->dev, "Failed to map resource: %s\n", res_name); 392 + return ERR_PTR(-ENOMEM); 393 + } 392 394 393 395 return mapped; 394 396 }