]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2026 10:08:54 +0000 (11:08 +0100)
[ Upstream commit 0ffba246652faf4a36aedc66059c2f94e4c83ea5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igc/igc_main.c

index 18dad521aefcc3a0ddfcc502c5ad4068ff8216f6..65134be59754fd94d3b698e27a52a8b61dfb9d5a 100644 (file)
@@ -1704,11 +1704,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));
 }