Commit b7c4f0dc authored by Johannes Berg's avatar Johannes Berg Committed by Kleber Sacilotto de Souza

iwlwifi: check kasprintf() return value

BugLink: https://bugs.launchpad.net/bugs/1858462

[ Upstream commit 5974fbb5 ]

kasprintf() can fail, we should check the return value.

Fixes: 5ed540ae ("iwlwifi: use mac80211 throughput trigger")
Fixes: 8ca151b5 ("iwlwifi: add the MVM driver")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 7348df96
...@@ -184,6 +184,9 @@ void iwl_leds_init(struct iwl_priv *priv) ...@@ -184,6 +184,9 @@ void iwl_leds_init(struct iwl_priv *priv)
priv->led.name = kasprintf(GFP_KERNEL, "%s-led", priv->led.name = kasprintf(GFP_KERNEL, "%s-led",
wiphy_name(priv->hw->wiphy)); wiphy_name(priv->hw->wiphy));
if (!priv->led.name)
return;
priv->led.brightness_set = iwl_led_brightness_set; priv->led.brightness_set = iwl_led_brightness_set;
priv->led.blink_set = iwl_led_blink_set; priv->led.blink_set = iwl_led_blink_set;
priv->led.max_brightness = 1; priv->led.max_brightness = 1;
......
...@@ -109,6 +109,9 @@ int iwl_mvm_leds_init(struct iwl_mvm *mvm) ...@@ -109,6 +109,9 @@ int iwl_mvm_leds_init(struct iwl_mvm *mvm)
mvm->led.name = kasprintf(GFP_KERNEL, "%s-led", mvm->led.name = kasprintf(GFP_KERNEL, "%s-led",
wiphy_name(mvm->hw->wiphy)); wiphy_name(mvm->hw->wiphy));
if (!mvm->led.name)
return -ENOMEM;
mvm->led.brightness_set = iwl_led_brightness_set; mvm->led.brightness_set = iwl_led_brightness_set;
mvm->led.max_brightness = 1; mvm->led.max_brightness = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment