All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] oradax: Fix return value check in dax_attach()
@ 2018-01-27  8:10 Wei Yongjun
  2018-01-29 19:29 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2018-01-27  8:10 UTC (permalink / raw)
  To: kernel-janitors

In case of error, the function class_create() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Fixes: dd0273284c74 ("sparc64: Oracle DAX driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/sbus/char/oradax.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/sbus/char/oradax.c b/drivers/sbus/char/oradax.c
index 10452ae..03dc047 100644
--- a/drivers/sbus/char/oradax.c
+++ b/drivers/sbus/char/oradax.c
@@ -336,9 +336,9 @@ static int __init dax_attach(void)
 	}
 
 	cl = class_create(THIS_MODULE, DAX_NAME);
-	if (cl = NULL) {
+	if (IS_ERR(cl)) {
 		dax_err("class_create failed");
-		ret = -ENXIO;
+		ret = PTR_ERR(cl);
 		goto class_error;
 	}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] oradax: Fix return value check in dax_attach()
  2018-01-27  8:10 [PATCH -next] oradax: Fix return value check in dax_attach() Wei Yongjun
@ 2018-01-29 19:29 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-01-29 19:29 UTC (permalink / raw)
  To: kernel-janitors

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Sat, 27 Jan 2018 08:10:59 +0000

> In case of error, the function class_create() returns ERR_PTR() and
> never returns NULL. The NULL test in the return value check should be
> replaced with IS_ERR().
> 
> Fixes: dd0273284c74 ("sparc64: Oracle DAX driver")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-29 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-27  8:10 [PATCH -next] oradax: Fix return value check in dax_attach() Wei Yongjun
2018-01-29 19:29 ` David Miller

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.