diff options
author | Benjamin Beichler <benjamin.beichler@uni-rostock.de> | 2018-01-22 20:04:36 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-01-31 14:46:39 +0300 |
commit | 301b04040c3ea2512b8936f419efbbaef2645ccb (patch) | |
tree | a4eb8e44957bf26ccc96164fa2f1459f03f8920d /drivers/net/wireless | |
parent | cb1a5bae568450b96c6828f235589cb42ce1dc81 (diff) | |
download | linux-301b04040c3ea2512b8936f419efbbaef2645ccb.tar.xz |
mac80211_hwsim: add nl_err_msg in hwsim_new_radio in netlink case
Add a NL_ERR_MSG in case of creating a radio by a netlink message to give
clear output to the creating process instead of creating only a debug
message in kernel log. The same function is used for the creation while
module load, so keep the old message, although it should never be thrown
while load, because the module controls all mac addresses.
Signed-off-by: Benjamin Beichler <benjamin.beichler@uni-rostock.de>
[remove message, add missing braces]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 12b727ba9dec..6996dad24e71 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2797,8 +2797,11 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, err = rhashtable_insert_fast(&hwsim_radios_rht, &data->rht, hwsim_rht_params); if (err < 0) { - pr_debug("mac80211_hwsim: radio index %d already present\n", - idx); + if (info) { + GENL_SET_ERR_MSG(info, "perm addr already present"); + NL_SET_BAD_ATTR(info->extack, + info->attrs[HWSIM_ATTR_PERM_ADDR]); + } spin_unlock_bh(&hwsim_radio_lock); goto failed_final_insert; } |