[PATCH] Report scan_abort as part of iw phy

2016-10-08 Thread Ola Olsson
nl80211: abort_scan has not been reported under the 'Supported commands' category when calling iw phy. Add that. Signed-off-by: Ola Olsson --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 95d55d2..0bbc

[PATCH] nl80211: Zero out the connection keys memory when freeing them.

2016-02-10 Thread Ola Olsson
The connection keys are zeroed out in all other cases except this one. Let's fix the last one as well. Signed-off-by: Ola Olsson --- net/wireless/nl80211.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 72

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-17 Thread Ola Olsson
> Using > WARN_ON(!a ^ !b) > which is logically the same as what I wrote above > for clarity is simply a bit more coverage and maybe > even a bit run-time faster. > > Didn't think about that. Love your bit fiddling trick! After an approval/rejection of my patch I can submit another one with

Re: [PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-16 Thread Ola Olsson
> but maybe it should be > > WARN_ON((ops->add_station && !ops->del_station) || > (!opt->add_station && ops->del_station)) > > etc... Ahh, got it! I really like your idea but I assume it's quite rare to implement the "stop/del/leave/disconnect" callbacks and at the same tim

[PATCH] Print warnings for missing cfg80211_ops implementations

2015-12-16 Thread Ola Olsson
Print a warning whenever an expected callback function lacks implementation. Signed-off-by: Ola Olsson --- net/wireless/core.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/net/wireless/core.c b/net/wireless/core.c index b091551..3a9c41b 100644 --- a/net/wireless/core.c

Re: [PATCH] nl80211: Potential memory leaks in reg.c

2015-12-16 Thread Ola Olsson
> I'm just surprised that none of the tools we (and others) typically run > found these, and thought perhaps you had a better tool than we do... > I guess it's called "brain" and we just don't use it right ;-) Hahaha, I doubt that is the case. :) -- To unsubscribe from this list: send the line "un

Re: [PATCH] nl80211: Potential memory leaks in reg.c

2015-12-15 Thread Ola Olsson
n Tue, Dec 15, 2015 at 1:09 PM, Johannes Berg wrote: > On Sun, 2015-12-13 at 19:12 +0100, Ola Olsson wrote: >> The first leak occurs when entering the default case >> in the switch for the initiator in set_regdom. >> The second leaks a platform_device struct if the >> pla

[PATCH] nl80211: Potential memory leaks in reg.c

2015-12-13 Thread Ola Olsson
The first leak occurs when entering the default case in the switch for the initiator in set_regdom. The second leaks a platform_device struct if the platform registration in regulatory_init succeeds but the sub sequent regulatory hint fails due to no memory. Signed-off-by: Ola Olsson --- net

[PATCH] nl80211: Fix potential memory leak in nl80211_set_wowlan

2015-12-12 Thread Ola Olsson
Compared to cfg80211_rdev_free_wowlan in core.h, the error goto label lacks the freeing of nd_config. Fix that. Signed-off-by: Ola Olsson --- net/wireless/nl80211.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 4b5ff71..75b0d23

[PATCH] ocb: remove unnecessary variable increments

2015-12-12 Thread Ola Olsson
The arg[c|v] variables are incremented even if they are not used afterwards. Fix that. Signed-off-by: Ola Olsson --- ocb.c |3 --- 1 file changed, 3 deletions(-) diff --git a/ocb.c b/ocb.c index 767eb82..b43fba8 100644 --- a/ocb.c +++ b/ocb.c @@ -33,7 +33,6 @@ static int join_ocb(struct

[PATCH] nl80211: Fix potential memory leak in nl80211_connect

2015-12-11 Thread Ola Olsson
Free cached keys if the last early return path is taken. Signed-off-by: Ola Olsson --- net/wireless/nl80211.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c71e274..4b5ff71 100644 --- a/net/wireless/nl80211.c

[PATCH] cfg80211: ocb: Fix null pointer deref if join_ocb is unimplemented

2015-11-09 Thread Ola Olsson
Signed-off-by: Ola Olsson --- net/wireless/ocb.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/net/wireless/ocb.c b/net/wireless/ocb.c index c00d4a7..e64dbf1 100644 --- a/net/wireless/ocb.c +++ b/net/wireless/ocb.c @@ -29,6 +29,9 @@ int __cfg80211_join_ocb(struct

[PATCH] nl80211: Fix potential memory leak from parse_acl_data

2015-10-28 Thread Ola Olsson
If parse_acl_data succeeds but the subsequent parsing of smps attributes fails, there will be a memory leak due to early returns. Fix that. Signed-off-by: Ola Olsson --- net/wireless/nl80211.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/wireless

[PATCH] iw: Fix memory leak if nla_put fails

2015-10-23 Thread Ola Olsson
The NLA_PUT macro will automatically goto nla_put_failure if the underlying nla_put fails. This will in turn leak our malloced memory in both the scan and wowlan commands. Fix that by not using the macro in the cases where we have allocated heap mem. Signed-off-by: Ola Olsson --- scan.c

Re: [PATCH] iw: Print help text to "set bitrates" in case of no args

2015-10-21 Thread Ola Olsson
I totally missed that. You are right! /Ola On Wed, Oct 21, 2015 at 2:27 PM, Johannes Berg wrote: > This is incorrect - the help states: > > "Not passing any arguments would clear the existing mask (if any)." > > johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless

[PATCH] mesh: show mesh parameters when no args are given

2015-10-21 Thread Ola Olsson
The help text in " mesh_param" says that available parameters will be shown if no args are given but that is not the case - fix that. Also, add help text if a parameter is given but not found. Signed-off-by: Ola Olsson --- mesh.c | 23 --- 1 file changed, 16

[PATCH] iw: Print help text to "set bitrates" in case of no args

2015-10-21 Thread Ola Olsson
Signed-off-by: Ola Olsson --- bitrate.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/bitrate.c b/bitrate.c index 4a026a4..974b49c 100644 --- a/bitrate.c +++ b/bitrate.c @@ -110,6 +110,9 @@ static int handle_bitrates(struct nl80211_state *state, S_GI

[PATCH] iw: remove superfluous includes

2015-10-21 Thread Ola Olsson
Signed-off-by: Ola Olsson --- coalesce.c |2 -- info.c |1 - link.c |1 - mpp.c |1 - p2p.c |3 --- scan.c |1 - survey.c |2 -- 7 files changed, 11 deletions(-) diff --git a/coalesce.c b/coalesce.c index fabf44a..36dcaef 100644 --- a

[PATCH] iw: Fix segfault when no args are given to offchannel

2015-10-21 Thread Ola Olsson
The offchannel command assumes that frequency and duration are given as arguments, otherwise iw segfaults - fix that by printing help text instead. Signed-off-by: Ola Olsson --- offch.c |4 1 file changed, 4 insertions(+) diff --git a/offch.c b/offch.c index 49b101a..04bf4c6 100644

Re: [PATCH] ocb: use correct "MHz" instead of "MHZ"

2015-10-14 Thread Ola Olsson
> Yeah, ouch, I don't really want that. Perhaps you can add -Wno-unused > -parameters to your Android makefile. Worked like a charm (though I had to remove 's' in parameters). Thanks! > > I guess? Not sure I want to fix it - doesn't really seem worth much. > That's ok! -- To unsubscribe from this

Re: [PATCH] ocb: use correct "MHz" instead of "MHZ"

2015-10-14 Thread Ola Olsson
> Hm. I think -Wunused-parameter I'd prefer not to fix, since that > usually ends up with something like > > int my_callback_function(void *ignored) > { > ignored = ignored; > > ... > } > > or something like that? Correct. I have done a macro to utilize the gcc "__attribute__ ((unu

Re: [PATCH] ocb: use correct "MHz" instead of "MHZ"

2015-10-13 Thread Ola Olsson
Absolutely, I will do that. May I ask if you are interested in patches that removes the compiler warnings on Android? I have cloned the iw git under the external folder in the android tree and everything compiles fine with "mm" but there are a lot of warnings. Most warnings are unused-parameter an

[PATCH] iw: Fixes help text for event

2015-10-12 Thread Ola Olsson
According to source, the -t and -r options are mutually exclusive. This commit fixes the help text accordingly. Signed-off-by: Ola Olsson --- event.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/event.c b/event.c index 5d0bfde..a342dc4 100644 --- a/event.c +++ b

[PATCH] iw: Adding helpful hints for vendor cmd

2015-10-12 Thread Ola Olsson
Without having access to the source, it was hard to know the format of vendor oui and sub cmd. This commit fixes that. Signed-off-by: Ola Olsson --- vendor.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/vendor.c b/vendor.c index d0b4f9e..86c03d1 100644

[PATCH] ocb: use correct "MHz" instead of "MHZ"

2015-10-12 Thread Ola Olsson
Fixes the last typos of MHZ to MHz Signed-off-by: Ola Olsson --- ocb.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ocb.c b/ocb.c index fc48ecf..c60591c 100644 --- a/ocb.c +++ b/ocb.c @@ -18,9 +18,9 @@ static int join_ocb(struct nl80211_state *state

[PATCH] iw: Fix return values when parameters are wrong

2015-10-12 Thread Ola Olsson
According to header file, wrong parameters yield 1 as return value. Also tried to fix the comments since one part of it was unreadable. Signed-off-by: Ola Olsson --- interface.c |6 ++ iw.h|4 ++-- ps.c|6 ++ 3 files changed, 6 insertions(+), 10 deletions

[PATCH] iw: Fix memory leak in error path

2015-10-09 Thread Ola Olsson
The leak is present if malloc fails after requesting a scan with ies or meshid as input. Signed-off-by: Ola Olsson --- scan.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scan.c b/scan.c index 8197679..d3c7d98 100644 --- a/scan.c +++ b/scan.c @@ -446,8 +446,11

[PATCH] iw: Fix return values when parameters are wrong

2015-10-07 Thread Ola Olsson
According to header file, wrong parameters yield 1 as return value. Also tried to fix the comments since one part of it was unreadable. Signed-off-by: Ola Olsson --- interface.c |6 ++ iw.h|4 ++-- ps.c|6 ++ 3 files changed, 6 insertions(+), 10 deletions

[PATCH] iw: use correct "MHz" instead of "MHZ"

2015-10-05 Thread Ola Olsson
Fixes the last MHZ to MHz. Signed-off-by: Ola Olsson --- ocb.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ocb.c b/ocb.c index fc48ecf..c60591c 100644 --- a/ocb.c +++ b/ocb.c @@ -18,9 +18,9 @@ static int join_ocb(struct nl80211_state *state

[PATCH] Remove superfluous header files

2015-10-04 Thread Ola Olsson
if.h only contains if_nametoindex and the reverse. Lets remove the inclusion in the source files where these functions are not called. Signed-off-by: Ola Olsson --- coalesce.c |1 - hwsim.c |1 - info.c |1 - interface.c |1 - mesh.c |1 - ocb.c |1

Re: [PATCH] iw: Memory leak in error condition

2015-09-30 Thread Ola Olsson
I guess not since there is a goto statement in between. Please correct me if I am wrong. /Ola On Thu, Oct 1, 2015 at 1:34 AM, Julian Calaby wrote: > Hi Ola, > > On Thu, Oct 1, 2015 at 9:27 AM, Ola Olsson wrote: >> Oh yes! :) >> Suddenly valgrind was happ

Re: [PATCH] iw: Memory leak in error condition

2015-09-30 Thread Ola Olsson
Oh yes! :) Suddenly valgrind was happy as well. >From 2724dd259f2bf61a2b7c85a70a70fd640a583453 Mon Sep 17 00:00:00 2001 From: Ola Olsson Date: Thu, 1 Oct 2015 00:43:06 +0200 Subject: [PATCH] iw: Memory leak in error condition Signed-off-by: Ola Olsson --- scan.c |5 - 1 file chan

[PATCH] iw: Memory leak in error condition

2015-09-30 Thread Ola Olsson
>From 5239e8e9aa79a131b716398efbf7a1203decbd9b Mon Sep 17 00:00:00 2001 From: Ola Olsson Date: Thu, 1 Oct 2015 00:43:06 +0200 Subject: [PATCH] iw: Memory leak in error condition Signed-off-by: Ola Olsson --- scan.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/scan.c b/scan.c in