mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
iwlwifi: check kasprintf() return value
[ Upstream commit5974fbb5e1] kasprintf() can fail, we should check the return value. Fixes:5ed540aecc("iwlwifi: use mac80211 throughput trigger") Fixes:8ca151b568("iwlwifi: add the MVM driver") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
70d3d1aa96
commit
a1c90bd0de
@@ -171,6 +171,9 @@ void iwl_leds_init(struct iwl_priv *priv)
|
||||
|
||||
priv->led.name = kasprintf(GFP_KERNEL, "%s-led",
|
||||
wiphy_name(priv->hw->wiphy));
|
||||
if (!priv->led.name)
|
||||
return;
|
||||
|
||||
priv->led.brightness_set = iwl_led_brightness_set;
|
||||
priv->led.blink_set = iwl_led_blink_set;
|
||||
priv->led.max_brightness = 1;
|
||||
|
||||
@@ -129,6 +129,9 @@ int iwl_mvm_leds_init(struct iwl_mvm *mvm)
|
||||
|
||||
mvm->led.name = kasprintf(GFP_KERNEL, "%s-led",
|
||||
wiphy_name(mvm->hw->wiphy));
|
||||
if (!mvm->led.name)
|
||||
return -ENOMEM;
|
||||
|
||||
mvm->led.brightness_set = iwl_led_brightness_set;
|
||||
mvm->led.max_brightness = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user