mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
net: hns: fix return value check in __lb_other_process()
[ Upstream commit5ede3ada3d] The function skb_copy() could return NULL, the return value need to be checked. Fixes:b5996f11ea("net: add Hisilicon Network Subsystem basic ethernet support") Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7a20969b87
commit
cd63471a41
@@ -415,6 +415,10 @@ static void __lb_other_process(struct hns_nic_ring_data *ring_data,
|
||||
/* for mutl buffer*/
|
||||
new_skb = skb_copy(skb, GFP_ATOMIC);
|
||||
dev_kfree_skb_any(skb);
|
||||
if (!new_skb) {
|
||||
netdev_err(ndev, "skb alloc failed\n");
|
||||
return;
|
||||
}
|
||||
skb = new_skb;
|
||||
|
||||
check_ok = 0;
|
||||
|
||||
Reference in New Issue
Block a user