mt7603: mcu: fix potential NULL pointer dereferencing on failed allocation

Signed-off-by: Lorenzo Bianconi <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2017-12-15 15:31:01 +01:00
committed by Felix Fietkau
parent 31e9bdb1af
commit bf90dd27eb
+3
View File
@@ -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);