Skip to content

Commit 61fb097

Browse files
pkwapulianguy11
authored andcommitted
ixgbe: Fix possible skb NULL pointer dereference
The commit c824125 ("ixgbe: Fix passing 0 to ERR_PTR in ixgbe_run_xdp()") stopped utilizing the ERR-like macros for xdp status encoding. Propagate this logic to the ixgbe_put_rx_buffer(). The commit also relaxed the skb NULL pointer check - caught by Smatch. Restore this check. Fixes: c824125 ("ixgbe: Fix passing 0 to ERR_PTR in ixgbe_run_xdp()") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/intel-wired-lan/[email protected]/ Acked-by: Maciej Fijalkowski <[email protected]> Signed-off-by: Piotr Kwapulinski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Saritha Sanigani <[email protected]> (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 52c11d3 commit 61fb097

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ static void ixgbe_put_rx_buffer(struct ixgbe_ring *rx_ring,
21052105
/* hand second half of page back to the ring */
21062106
ixgbe_reuse_rx_page(rx_ring, rx_buffer);
21072107
} else {
2108-
if (!IS_ERR(skb) && IXGBE_CB(skb)->dma == rx_buffer->dma) {
2108+
if (skb && IXGBE_CB(skb)->dma == rx_buffer->dma) {
21092109
/* the page has been released from the ring */
21102110
IXGBE_CB(skb)->page_released = true;
21112111
} else {

0 commit comments

Comments
 (0)