staging: lustre: obd: check for allocation failure
Subsystems (2)
PATCH 1/1 staging: lustre: obd: check for allocation failure
lustre_cfg_new() can fail with ERR_PTR(-ENOMEM) so we should check for that.
Fixes d7e09d0397e8 ("staging: add Lustre file system client support")
Signed-off-by Dan Carpenter <[email protected]>
drivers/staging/lustre/lustre/obdclass/obd_mount.c +2 -0
@@ -159,6 +159,8 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,lustre_cfg_bufs_set_string (&bufs,4 , s4); lcfg =lustre_cfg_new (cmd, &bufs); +if (IS_ERR (lcfg)) +return PTR_ERR (lcfg); lcfg->lcfg_nid = nid; rc =class_process_config (lcfg);lustre_cfg_free (lcfg);
Greg Kroah-Hartman
maintainerQuoted 11 lines · Dan Carpenter
lustre_cfg_new()can fail withERR_PTR(-ENOMEM)so we should check for that.Fixes d7e09d0397e8 ("staging: add Lustre file system client support")Signed-off-by Dan Carpenter <[email protected]>drivers/staging/lustre/lustre/obdclass/obd_mount.c +0
-0
drivers/staging/lustre/lustre/obdclass/obd_mount.c static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, · line 166
Quoted 8 lines
drivers/staging/lustre/lustre/obdclass/obd_mount.c +2
-0@@ -159,6 +159,8 @@ static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,lustre_cfg_bufs_set_string (&bufs,4 , s4); lcfg =lustre_cfg_new (cmd, &bufs); +if (IS_ERR (lcfg)) +return PTR_ERR (lcfg); lcfg->lcfg_nid = nid; rc =class_process_config (lcfg);lustre_cfg_free (lcfg);
Doesn't apply to my tree anymore :(