* [PATCH] Mailbox: Fix return value check in pcc_init()
@ 2015-01-14 1:10 weiyj_lk
0 siblings, 0 replies; only message in thread
From: weiyj_lk @ 2015-01-14 1:10 UTC (permalink / raw)
To: Jassi Brar; +Cc: Wei Yongjun, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
In case of error, the function platform_create_bundle() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/mailbox/pcc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 6dbf6fc..70576fb 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -393,9 +393,9 @@ static int __init pcc_init(void)
pcc_pdev = platform_create_bundle(&pcc_mbox_driver,
pcc_mbox_probe, NULL, 0, NULL, 0);
- if (!pcc_pdev) {
+ if (IS_ERR(pcc_pdev)) {
pr_err("Err creating PCC platform bundle\n");
- return -ENODEV;
+ return PTR_ERR(pcc_pdev);
}
return 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-01-14 1:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-14 1:10 [PATCH] Mailbox: Fix return value check in pcc_init() weiyj_lk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.