Skip to contentSkip to conversation

mwifiex: fix a reversed condition

PATCH Applied Dan Carpenter 3 participants 3 messages Feb 2, 2016 – Feb 6, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mwifiex: fix a reversed condition

The NULL test here is reversed.

Fixes 7d7f07d8c5d3 ('mwifiex: add wowlan net-detect support')
drivers/net/wireless/marvell/mwifiex/scan.c +1 -1
index fc8d8ca..489f7a9 100644
@@ -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;
#1 lore raw
Quoted 1 line · Dan Carpenter

The NULL test here is reversed.

[]

drivers/net/wireless/marvell/mwifiex/scan.c

Quoted 1 line
drivers/net/wireless/marvell/mwifiex/scan.c +0 -0

[]

Quoted 7 lines
drivers/net/wireless/marvell/mwifiex/scan.c +0 -0
@@ -2196,7 +2196,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,


  pmatch = adapter->nd_info->matches[idx];

drivers/net/wireless/marvell/mwifiex/scan.c +1 -1
-			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 kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html