diff mbox

mwifiex: fix a reversed condition

Message ID 20160202100005.GA3040@mwanda (mailing list archive)
State Accepted
Delegated to: Kalle Valo
Headers show

Commit Message

Dan Carpenter Feb. 2, 2016, 10 a.m. UTC
The NULL test here is reversed.

Fixes: 7d7f07d8c5d3 ('mwifiex: add wowlan net-detect support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Joe Perches Feb. 2, 2016, 2:33 p.m. UTC | #1
On Tue, 2016-02-02 at 13:00 +0300, Dan Carpenter wrote:
> The NULL test here is reversed.
[]
> diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
[]
> @@ -2196,7 +2196,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
>  
>  			pmatch = adapter->nd_info->matches[idx];
>  
> -			if (!pmatch) {
> +			if (pmatch) {
>  				memset(pmatch, 0, sizeof(*pmatch));

As it's just been kzalloc'ed,
this memset seems unnecessary as well.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo Feb. 6, 2016, 12:01 p.m. UTC | #2
> The NULL test here is reversed.
> 
> Fixes: 7d7f07d8c5d3 ('mwifiex: add wowlan net-detect support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index fc8d8ca..489f7a9 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -2196,7 +2196,7 @@  int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
 
 			pmatch = adapter->nd_info->matches[idx];
 
-			if (!pmatch) {
+			if (pmatch) {
 				memset(pmatch, 0, sizeof(*pmatch));
 				if (chan_band_tlv) {
 					pmatch->n_channels = 1;