All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] staging: lustre: checking for NULL instead of IS_ERR
@ 2016-03-18  5:42 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2016-03-18  5:42 UTC (permalink / raw)
  To: lustre-devel

lustre_cfg_new() returns error pointers on error, it never returns NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 65caffe..b7dc872 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;
 		}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-18 19:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18  5:42 [patch] staging: lustre: checking for NULL instead of IS_ERR Dan Carpenter
2016-03-18  5:42 ` [lustre-devel] " Dan Carpenter
2016-03-18 19:28 ` Dilger, Andreas
2016-03-18 19:28   ` [lustre-devel] " Dilger, Andreas
2016-03-18 19:38   ` Dilger, Andreas
2016-03-18 19:38     ` Dilger, Andreas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.