mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7603: mcu: fix potential NULL pointer dereferencing on failed allocation
Signed-off-by: Lorenzo Bianconi <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
d543b03eac
commit
dd270b09a7
@@ -33,6 +33,9 @@ static struct sk_buff *mt7603_mcu_msg_alloc(const void *data, int len)
|
||||
|
||||
skb = alloc_skb(len + sizeof(struct mt7603_mcu_txd),
|
||||
GFP_KERNEL);
|
||||
if (!skb)
|
||||
return NULL;
|
||||
|
||||
skb_reserve(skb, sizeof(struct mt7603_mcu_txd));
|
||||
if (data && len)
|
||||
memcpy(skb_put(skb, len), data, len);
|
||||
|
||||
Reference in New Issue
Block a user