Эх сурвалжийг харах

iwlwifi: mvm: fix possible memory leak

iwl_parse_nvm_data() doesn't free allocated memory if it is
fed with invalid parameter. Fix this.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eytan Lifshitz 11 жил өмнө
parent
commit
1270c416e1

+ 1 - 0
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c

@@ -516,6 +516,7 @@ iwl_parse_nvm_data(struct device *dev, const struct iwl_cfg *cfg,
 		if (!nvm_calib) {
 		if (!nvm_calib) {
 			IWL_ERR_DEV(dev,
 			IWL_ERR_DEV(dev,
 				    "Can't parse empty Calib NVM sections\n");
 				    "Can't parse empty Calib NVM sections\n");
+			kfree(data);
 			return NULL;
 			return NULL;
 		}
 		}
 		/* in family 8000 Xtal calibration values moved to OTP */
 		/* in family 8000 Xtal calibration values moved to OTP */