mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
net: dsa: qca8k: Add check for skb_copy
[ Upstream commit87355b7c3d] Add check for the return value of skb_copy in order to avoid NULL pointer dereference. Fixes:2cd5485663("net: dsa: qca8k: add support for phy read/write with mgmt Ethernet") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
436b7cc7ea
commit
89726b0303
@@ -469,6 +469,9 @@ qca8k_phy_eth_busy_wait(struct qca8k_mgmt_eth_data *mgmt_eth_data,
|
||||
bool ack;
|
||||
int ret;
|
||||
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
|
||||
reinit_completion(&mgmt_eth_data->rw_done);
|
||||
|
||||
/* Increment seq_num and set it in the copy pkt */
|
||||
|
||||
Reference in New Issue
Block a user