mwifiex: avoid -Wstringop-overflow warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 30 Apr 2020 21:30:45 +0000 (23:30 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 6 May 2020 08:43:14 +0000 (11:43 +0300)
commit08afb432c996e34e7047110a4d8c6979b8bd2b19
tree170f27d4a81e0adafa91bf9afa93e93c45fd4f1a
parent1b56bed20212390432541c7a54e5a70561809293
mwifiex: avoid -Wstringop-overflow warning

gcc-10 reports a warning for mwifiex_cmd_802_11_key_material_v1:

drivers/net/wireless/marvell/mwifiex/sta_cmd.c: In function 'mwifiex_cmd_802_11_key_material_v1':
cc1: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=]
In file included from drivers/net/wireless/marvell/mwifiex/sta_cmd.c:23:
drivers/net/wireless/marvell/mwifiex/fw.h:993:9: note: at offset 0 to object 'action' with size 2 declared here
  993 |  __le16 action;
      |         ^~~~~~

As the warning makes no sense, I reported it as a bug for gcc. In the
meantime using a temporary pointer for the key data makes the code easier
to read and stops the warning.

Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94881
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200430213101.135134-4-arnd@arndb.de
drivers/net/wireless/marvell/mwifiex/sta_cmd.c