staging: lustre: checking for NULL instead of IS_ERR
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 18 Mar 2016 05:42:47 +0000 (08:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Mar 2016 02:22:13 +0000 (22:22 -0400)
lustre_cfg_new() returns error pointers on error, it never returns NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/mgc/mgc_request.c

index 65caffe8c42eed623be8c1b85ef99076a05a6c9a..b7dc87248032fcbf1afea9975193810109c4ca0a 100644 (file)
@@ -1282,7 +1282,7 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
 
                rc = -ENOMEM;
                lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
-               if (!lcfg) {
+               if (IS_ERR(lcfg)) {
                        CERROR("mgc: cannot allocate memory\n");
                        break;
                }