mirror of
https://github.com/torvalds/linux.git
synced 2024-12-15 07:33:56 +00:00
mt7601u: null check the allocation
devm_kzalloc may fail and return NULL. So the null check is needed. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Acked-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
cddecd92d1
commit
b95c732234
@ -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 >
|
||||
|
Loading…
Reference in New Issue
Block a user