[PATCH -next] oradax: Fix return value check in dax_attach()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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;
 	}

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux