]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ice: Remove possible null dereference
authorTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 6 Feb 2020 09:20:08 +0000 (01:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 16:23:41 +0000 (17:23 +0100)
commit 0a6ea04e3bbd20833d2b49296e5adc1c5bb86386 upstream.

Commit 1f45ebe0d8fb ("ice: add extra check for null Rx descriptor") moved
the call to ice_construct_skb() under a null check as Coverity reported a
possible use of null skb. However, the original call was not deleted, do so
now.

Fixes: 1f45ebe0d8fb ("ice: add extra check for null Rx descriptor")
Reported-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/ice/ice_txrx.c

index 8b2b9e254d28d0045268bcaa9b1033f531b75905..f4015a5fb5c0c1dfe29d4a91b248818e6c74fe79 100644 (file)
@@ -1078,8 +1078,6 @@ construct_skb:
                                skb = ice_build_skb(rx_ring, rx_buf, &xdp);
                        else
                                skb = ice_construct_skb(rx_ring, rx_buf, &xdp);
-               } else {
-                       skb = ice_construct_skb(rx_ring, rx_buf, &xdp);
                }
                /* exit if we failed to retrieve a buffer */
                if (!skb) {