sfc: ef10: Fix assigning negative value to unsigned variable
authorHaowen Bai <baihaowen@meizu.com>
Mon, 11 Apr 2022 01:32:37 +0000 (09:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:32 +0000 (10:22 +0200)
[ Upstream commit b8ff3395fbdf3b79a99d0ef410fc34c51044121e ]

fix warning reported by smatch:
251 drivers/net/ethernet/sfc/ef10.c:2259 efx_ef10_tx_tso_desc()
warn: assigning (-208) to unsigned variable 'ip_tot_len'

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://lore.kernel.org/r/1649640757-30041-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sfc/ef10.c

index f5a4d8f4fd1145686ef0ee0708939cc452f7088b..c1cd1c97f09ddda1b6327770659d6160cbc266e1 100644 (file)
@@ -2256,7 +2256,7 @@ int efx_ef10_tx_tso_desc(struct efx_tx_queue *tx_queue, struct sk_buff *skb,
         * guaranteed to satisfy the second as we only attempt TSO if
         * inner_network_header <= 208.
         */
-       ip_tot_len = -EFX_TSO2_MAX_HDRLEN;
+       ip_tot_len = 0x10000 - EFX_TSO2_MAX_HDRLEN;
        EFX_WARN_ON_ONCE_PARANOID(mss + EFX_TSO2_MAX_HDRLEN +
                                  (tcp->doff << 2u) > ip_tot_len);