[PATCH] Fix oops when set_monitor_enabled() not defined in the struct cfg80211_ops

Subsystems: 802.11 (including cfg80211/nl80211), the rest

STALE5137d

4 messages, 3 authors, 2012-07-09 · open the first message on its own page

[PATCH] Fix oops when set_monitor_enabled() not defined in the struct cfg80211_ops

From: Vladimir Kondratiev <hidden>
Date: 2012-07-08 11:08:25

Quick fix for method being invoked without checking its existence

Signed-off-by: Vladimir Kondratiev <redacted>
---
 net/wireless/core.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
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 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
 
 	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;
-- 
1.7.9.5

Re: [PATCH] Fix oops when set_monitor_enabled() not defined in the struct cfg80211_ops

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2012-07-08 11:11:34

On Sun, 2012-07-08 at 14:08 +0300, Vladimir Kondratiev wrote:
quoted hunk
Quick fix for method being invoked without checking its existence

Signed-off-by: Vladimir Kondratiev <redacted>
---
 net/wireless/core.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
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 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
 
 	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);
Oh, good catch, applied

johannes

Re: [PATCH] Fix oops when set_monitor_enabled() not defined in the struct cfg80211_ops

From: Kalle Valo <hidden>
Date: 2012-07-09 13:26:00

Johannes Berg [off-list ref] writes:
On Sun, 2012-07-08 at 14:08 +0300, Vladimir Kondratiev wrote:
quoted
Quick fix for method being invoked without checking its existence

Signed-off-by: Vladimir Kondratiev <redacted>
[...]
Oh, good catch, applied
Title is missing "cfg80211: " prefix. Is it too late to change that?

-- 
Kalle Valo

Re: [PATCH] Fix oops when set_monitor_enabled() not defined in the struct cfg80211_ops

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2012-07-09 13:29:41

On Mon, 2012-07-09 at 16:25 +0300, Kalle Valo wrote:
Johannes Berg [off-list ref] writes:
quoted
On Sun, 2012-07-08 at 14:08 +0300, Vladimir Kondratiev wrote:
quoted
Quick fix for method being invoked without checking its existence

Signed-off-by: Vladimir Kondratiev <redacted>
[...]
quoted
Oh, good catch, applied
Title is missing "cfg80211: " prefix. Is it too late to change that?
I fixed it when applying :-)

http://git.kernel.org/?p=linux/kernel/git/jberg/mac80211-next.git;a=commitdiff;h=56af8f9af99223610f0582594bd4ac0a0320eb71

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help