wifi: iwlwifi: pcie: Fix TSO preparation
authorIlan Peer <ilan.peer@intel.com>
Thu, 6 Mar 2025 10:25:46 +0000 (12:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 7 Mar 2025 08:57:38 +0000 (09:57 +0100)
commitbbb18f7e23a3f5f56d5c8b4ee0f78f00edb3b1b2
tree2ab8f5aa560e64e20bc3b3f00b0145b44037d754
parentd048c84bc1d6b831ca4e3381a16fb616ad96d8db
wifi: iwlwifi: pcie: Fix TSO preparation

The allocation of the scatter gather data structure should be done
based on the number of memory chunks that need to be mapped, and it
is not dependent on the overall payload length. Fix it.

In addition, as the skb_to_sgvec() function returns an 'int' do not
assign it to an 'unsigned int' as otherwise the error check would be
useless.

Fixes: 7f5e3038f029 ("wifi: iwlwifi: map entire SKB when sending AMSDUs")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250306122425.8c0e23a3d583.I3cb4d6768c9d28ce3da6cd0a6c65466176cfc1ee@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx.c