From 3092c34a4ae6129d97c550d5191cf3e31d14b3ff Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 18 Mar 2016 08:42:47 +0300 Subject: [PATCH] staging: lustre: checking for NULL instead of IS_ERR lustre_cfg_new() returns error pointers on error, it never returns NULL. Signed-off-by: Dan Carpenter Reviewed-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 65caffe8c42e..b7dc87248032 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -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; }