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