mt76_init_sband_2g: null check the allocation
PATCH 1/1 mt76_init_sband_2g: null check the allocation
devm_kzalloc may fail and return NULL. So the null check is needed.
--- drivers/net/wireless/mediatek/mt7601u/init.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/mediatek/mt7601u/init.c +3 -0
@@ -557,6 +557,9 @@ mt76_init_sband_2g(struct mt7601u_dev *dev) { dev->sband_2g =devm_kzalloc (dev->dev,sizeof (*dev->sband_2g),GFP_KERNEL ); +if (!dev->sband_2g) +return -ENOMEM ; + dev->hw->wiphy->bands[NL80211_BAND_2GHZ ] = dev->sband_2g; WARN_ON(dev->ee->reg.start - 1 + dev->ee->reg.num >
Signature · 1 line
2.17.1
Quoted 6 lines · Navid Emamdoost
devm_kzallocmay fail and return NULL. So the null check is needed.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/net/wireless/mediatek/mt7601u/init.c | 3 +++ 1 file changed, 3 insertions(+)
The prefix in the title should be "mt7601u:".
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#commit_title_is_wrong
Signature · 1 line
Kalle Valo
PATCH 1/1 mt7601u: null check the allocation
devm_kzalloc may fail and return NULL. So the null check is needed.
--- drivers/net/wireless/mediatek/mt7601u/init.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/mediatek/mt7601u/init.c +3 -0
@@ -557,6 +557,9 @@ mt76_init_sband_2g(struct mt7601u_dev *dev) { dev->sband_2g =devm_kzalloc (dev->dev,sizeof (*dev->sband_2g),GFP_KERNEL ); +if (!dev->sband_2g) +return -ENOMEM ; + dev->hw->wiphy->bands[NL80211_BAND_2GHZ ] = dev->sband_2g; WARN_ON(dev->ee->reg.start - 1 + dev->ee->reg.num >
Signature · 1 line
2.17.1
Re: [PATCH] mt7601u: null check the allocation
Quoted 3 lines · Navid Emamdoost
devm_kzallocmay fail and return NULL. So the null check is needed.Signed-off-by Navid Emamdoost <[email protected]>
Ah, I replied to the wrong one..
Re: [PATCH] mt7601u: null check the allocation
In reply to Navid EmamdoostQuoted 4 lines · Navid Emamdoost
devm_kzallocmay fail and return NULL. So the null check is needed.Signed-off-by Navid Emamdoost <[email protected]>Acked-by Jakub Kicinski <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
b95c732234fa mt7601u: null check the allocation
Signature · 3 lines
https://patchwork.kernel.org/patch/11057013/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH] mt7601u: null check the allocation
In reply to Navid EmamdoostQuoted 4 lines · Navid Emamdoost
devm_kzallocmay fail and return NULL. So the null check is needed.Signed-off-by Navid Emamdoost <[email protected]>Acked-by Jakub Kicinski <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
b95c732234fa mt7601u: null check the allocation
Signature · 3 lines
https://patchwork.kernel.org/patch/11057013/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 3 lines · Navid Emamdoost
devm_kzallocmay fail and return NULL. So the null check is needed.Signed-off-by Navid Emamdoost <[email protected]>
Thanks!