cfg80211: fix oops due to unassigned set_monitor_enabled callback
Quick fix for method being invoked without checking its existence.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
diff --git a/net/wireless/core.c b/net/wireless/core.c
index eb60410..e42a97b 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -774,8 +774,9 @@
has_monitors_only_new = cfg80211_has_monitors_only(rdev);
if (has_monitors_only_new != has_monitors_only_old) {
- rdev->ops->set_monitor_enabled(&rdev->wiphy,
- has_monitors_only_new);
+ if (rdev->ops->set_monitor_enabled)
+ rdev->ops->set_monitor_enabled(&rdev->wiphy,
+ has_monitors_only_new);
if (!has_monitors_only_new) {
rdev->monitor_channel = NULL;