cfg80211: Fix array-bounds warning in fragment copy
authorMatthias Kaehlcke <mka@chromium.org>
Thu, 13 Apr 2017 17:05:04 +0000 (10:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Apr 2018 10:12:46 +0000 (12:12 +0200)
commit4bb797afd7ba5d76fa6fa5a8d4fe930c2c2e029d
treedb02d660f204ba6a9a0dc644c6ddf4edb0b3e807
parent7164cb7360fe981fc4748afec4528f5c46091c86
cfg80211: Fix array-bounds warning in fragment copy

commit aa1702dd162f420bf85ecef0c77686ef0dbc1496 upstream.

__ieee80211_amsdu_copy_frag intentionally initializes a pointer to
array[-1] to increment it later to valid values. clang rightfully
generates an array-bounds warning on the initialization statement.

Initialize the pointer to array[0] and change the algorithm from
increment before to increment after consume.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/util.c