]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
igc: fix missing update of skb->tail in igc_xmit_frame()
authorKohei Enju <kohei@enjuk.jp>
Sat, 14 Feb 2026 19:46:32 +0000 (19:46 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 17 Mar 2026 20:28:55 +0000 (13:28 -0700)
igc_xmit_frame() misses updating skb->tail when the packet size is
shorter than the minimum one.
Use skb_put_padto() in alignment with other Intel Ethernet drivers.

Fixes: 0507ef8a0372 ("igc: Add transmit and receive fastpath and interrupt handlers")
Signed-off-by: Kohei Enju <kohei@enjuk.jp>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc_main.c

index b2e8d0c0f827f19a960b2204a1ed14a46af7e509..1c5d7b23f225fe3e802692f0ed16df9ad4795d59 100644 (file)
@@ -1730,11 +1730,8 @@ static netdev_tx_t igc_xmit_frame(struct sk_buff *skb,
        /* The minimum packet size with TCTL.PSP set is 17 so pad the skb
         * in order to meet this minimum size requirement.
         */
-       if (skb->len < 17) {
-               if (skb_padto(skb, 17))
-                       return NETDEV_TX_OK;
-               skb->len = 17;
-       }
+       if (skb_put_padto(skb, 17))
+               return NETDEV_TX_OK;
 
        return igc_xmit_frame_ring(skb, igc_tx_queue_mapping(adapter, skb));
 }