OSDN Git Service

wifi: qtnfmac: use struct_size and size_sub for payload length
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 7 Mar 2023 23:02:12 +0000 (15:02 -0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 13 Mar 2023 13:44:29 +0000 (15:44 +0200)
commit84e9e2102bdc4f60ce131dcb74046219dc4425ae
tree1a9cb7abad3e1b7f55577d4a3a7170e9bc665626
parenta23c82e006db2f073fb65da8762f63735a510409
wifi: qtnfmac: use struct_size and size_sub for payload length

Replace the calculations for the payload length in
qtnf_cmd_band_fill_iftype with struct_size() and size_sub(). While
the payload length does not get directly passed to an allocation function,
the performed calculation is still calculating the size of a flexible array
structure (minus the size of a header structure).

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Igor Mitsyanko <imitsyanko@quantenna.com>
Cc: Sergey Matyukevich <geomatsi@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230307230212.3735818-1-jacob.e.keller@intel.com
drivers/net/wireless/quantenna/qtnfmac/commands.c