* [PATCH 1/2] staging: lustre: obdclass: Fix error handling
@ 2016-11-06 17:11 Christophe JAILLET
0 siblings, 0 replies; only message in thread
From: Christophe JAILLET @ 2016-11-06 17:11 UTC (permalink / raw)
To: oleg.drokin, andreas.dilger, jsimmons, gregkh, emoly.liu
Cc: lustre-devel, devel, linux-kernel, kernel-janitors, Christophe JAILLET
'lustre_cfg_new()' does not return NULL but ERR_PTR(-ENOMEM)
So IS_ERR should be used to check the return value.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/staging/lustre/lustre/obdclass/obd_config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index bbed1b72d52e..0e922c5f8b33 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -1382,8 +1382,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) {
--
2.9.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-06 17:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-06 17:11 [PATCH 1/2] staging: lustre: obdclass: Fix error handling Christophe JAILLET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).