Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Lustre 2.15.0
-
3
-
9223372036854775807
Description
smatch highlighted problematic code in mdt_stack_init and mdt_quota_init
lcfg = lustre_cfg_new(LCFG_SETUP, bufs); if (lcfg == NULL) GOTO(class_detach, rc = -ENOMEM); ... class_detach: if (rc) class_detach(obd, lcfg); lcfg_cleanup: lustre_cfg_free(lcfg);
note that while lustre_cfs_Free is basically kfree, which is ok to work with NULL pointers, in reality it does
static inline void lustre_cfg_free(struct lustre_cfg *lcfg) { #ifdef __KERNEL__ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
which makes it not ok.