nl80211: fix radio statistics in survey dump
authorJohannes Berg <johannes.berg@intel.com>
Fri, 29 Oct 2021 07:25:39 +0000 (09:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:34 +0000 (09:48 +0100)
commit1d17f6179182bda790717520186d2fd475c73c73
treed9fee1c5312488f4ada1575a0280732636f3e67b
parent85f4a563c9e4a2dd7d4e48da224c64232caef1ee
nl80211: fix radio statistics in survey dump

[ Upstream commit ce6b69749961426c6d822215ded9e67154e1ad4f ]

Even if userspace specifies the NL80211_ATTR_SURVEY_RADIO_STATS
attribute, we cannot get the statistics because we're not really
parsing the incoming attributes properly any more.

Fix this by passing the attrbuf to nl80211_prepare_wdev_dump()
and filling it there, if given, and using a local version only
if no output is desired.

Since I'm touching it anyway, make nl80211_prepare_wdev_dump()
static.

Fixes: 50508d941c18 ("cfg80211: use parallel_ops for genl")
Reported-by: Jan Fuchs <jf@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Sven Eckelmann <sven@narfation.org>
Link: https://lore.kernel.org/r/20211029092539.2851b4799386.If9736d4575ee79420cbec1bd930181e1d53c7317@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/wireless/nl80211.c
net/wireless/nl80211.h