Skip to content

Commit 87355b7

Browse files
JiangJiasdavem330
authored andcommitted
net: dsa: qca8k: Add check for skb_copy
Add check for the return value of skb_copy in order to avoid NULL pointer dereference. Fixes: 2cd5485 ("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>
1 parent 73c4d1b commit 87355b7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/dsa/qca/qca8k-8xxx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ qca8k_phy_eth_busy_wait(struct qca8k_mgmt_eth_data *mgmt_eth_data,
588588
bool ack;
589589
int ret;
590590

591+
if (!skb)
592+
return -ENOMEM;
593+
591594
reinit_completion(&mgmt_eth_data->rw_done);
592595

593596
/* Increment seq_num and set it in the copy pkt */

0 commit comments

Comments
 (0)