diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-01-27 08:10:59 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-29 14:28:48 -0500 |
commit | 2d85ec8acb01601a216b6c591cab63bfaacd2083 (patch) | |
tree | 0027a9a6a6b5016a3d95a85e566ea1859aac824c | |
parent | b3ca676f681409301332a75049e3148b7cb86141 (diff) |
oradax: Fix return value check in dax_attach()
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/sbus/char/oradax.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/sbus/char/oradax.c b/drivers/sbus/char/oradax.c index 10452ae18ef1..03dc04739225 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; } |