Skip to contentSkip to conversation

staging: lustre: checking for NULL instead if IS_ERR

PATCH New Dan Carpenter 1 participant 1 message Apr 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: checking for NULL instead if IS_ERR

lustre_cfg_new() returns error pointers and never NULL.

drivers/staging/lustre/lustre/obdclass/obd_config.c +2 -2
index 8fce88f69039..6a7e7a7d2af1 100644
@@ -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) {