]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: lustre: checking for NULL instead if IS_ERR
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Apr 2017 08:31:53 +0000 (11:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Apr 2017 08:22:03 +0000 (10:22 +0200)
lustre_cfg_new() returns error pointers and never NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/obd_config.c

index 8fce88f6903962f91ff1dddeda1e9571f0c1e8a6..6a7e7a7d2af151539f3835a78ff49fbdf1006cc9 100644 (file)
@@ -1427,8 +1427,8 @@ int class_manual_cleanup(struct obd_device *obd)
        lustre_cfg_bufs_reset(&bufs, obd->obd_name);
        lustre_cfg_bufs_set_string(&bufs, 1, flags);
        lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs);
-       if (!lcfg)
-               return -ENOMEM;
+       if (IS_ERR(lcfg))
+               return PTR_ERR(lcfg);
 
        rc = class_process_config(lcfg);
        if (rc) {