2010-05-14 14:54:05

by Dan Carpenter

[permalink] [raw]
Subject: [patch -next] iwlwifi: testing the wrong variable in iwl_add_bssid_station()

The intent here is to test that "sta_id_r" is a valid pointer. We do
this same test later on in the function.

Btw iwl_add_bssid_station() is called from two places and "sta_id_r" is
a valid pointer from both callers.

Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 85ed235..83a2636 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -431,7 +431,7 @@ int iwl_add_bssid_station(struct iwl_priv *priv, const u8 *addr, bool init_rs,
struct iwl_link_quality_cmd *link_cmd;
unsigned long flags;

- if (*sta_id_r)
+ if (sta_id_r)
*sta_id_r = IWL_INVALID_STATION;

ret = iwl_add_station_common(priv, addr, 0, NULL, &sta_id);


2010-05-14 14:55:28

by Berg, Johannes

[permalink] [raw]
Subject: RE: [patch -next] iwlwifi: testing the wrong variable in iwl_add_bssid_station()

> The intent here is to test that "sta_id_r" is a valid pointer. We do
> this same test later on in the function.

Indeed, thanks.

> Btw iwl_add_bssid_station() is called from two places and "sta_id_r" is
> a valid pointer from both callers.

Which explains why I didn't see that, and probably means
that we don't need the test at all...

johannes

---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.