File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
drivers/net/ethernet/microchip/lan966x Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -425,7 +425,8 @@ static struct sk_buff *lan966x_fdma_rx_get_frame(struct lan966x_rx *rx)
425
425
lan966x_ifh_get_src_port (skb -> data , & src_port );
426
426
lan966x_ifh_get_timestamp (skb -> data , & timestamp );
427
427
428
- WARN_ON (src_port >= lan966x -> num_phys_ports );
428
+ if (WARN_ON (src_port >= lan966x -> num_phys_ports ))
429
+ goto free_skb ;
429
430
430
431
skb -> dev = lan966x -> ports [src_port ]-> dev ;
431
432
skb_pull (skb , IFH_LEN * sizeof (u32 ));
@@ -449,6 +450,8 @@ static struct sk_buff *lan966x_fdma_rx_get_frame(struct lan966x_rx *rx)
449
450
450
451
return skb ;
451
452
453
+ free_skb :
454
+ kfree_skb (skb );
452
455
unmap_page :
453
456
dma_unmap_page (lan966x -> dev , (dma_addr_t )db -> dataptr ,
454
457
FDMA_DCB_STATUS_BLOCKL (db -> status ),
You can’t perform that action at this time.
0 commit comments