2012-07-08 11:08:25

by Vladimir Kondratiev

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

Quick fix for method being invoked without checking its existence

Signed-off-by: Vladimir Kondratiev <[email protected]>
---
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



2012-07-09 13:29:41

by Johannes Berg

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

On Mon, 2012-07-09 at 16:25 +0300, Kalle Valo wrote:
> Johannes Berg <[email protected]> writes:
>
> > On Sun, 2012-07-08 at 14:08 +0300, Vladimir Kondratiev wrote:
> >> Quick fix for method being invoked without checking its existence
> >>
> >> Signed-off-by: Vladimir Kondratiev <[email protected]>
>
> [...]
>
> >
> > 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


2012-07-08 11:11:34

by Johannes Berg

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

On Sun, 2012-07-08 at 14:08 +0300, Vladimir Kondratiev wrote:
> Quick fix for method being invoked without checking its existence
>
> Signed-off-by: Vladimir Kondratiev <[email protected]>
> ---
> 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


2012-07-09 13:26:00

by Kalle Valo

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

Johannes Berg <[email protected]> writes:

> On Sun, 2012-07-08 at 14:08 +0300, Vladimir Kondratiev wrote:
>> Quick fix for method being invoked without checking its existence
>>
>> Signed-off-by: Vladimir Kondratiev <[email protected]>

[...]

>
> Oh, good catch, applied

Title is missing "cfg80211: " prefix. Is it too late to change that?

--
Kalle Valo