aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-24 14:13:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-27 15:24:22 -0400
commit5696aea6f243e40013d2b00cd140fd006ec20b9c (patch)
treea40223f42ac20cb82492ae0844992434d27f5379 /drivers/net/wireless/iwlwifi/iwl-sta.c
parentc2acea8e9b86ba5a5469ff477445676a223af4e2 (diff)
iwlwifi: remove command callback return value
No existing callbacks use anything other than the return value 1, which means that the caller should free the reply skb, so it seems safer in terms of not introducing memory leaks to simply remove the return value and let the caller always free the skb. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 1571ace05dde..79ea5cc2c89a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -97,9 +97,9 @@ static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
97 spin_unlock_irqrestore(&priv->sta_lock, flags); 97 spin_unlock_irqrestore(&priv->sta_lock, flags);
98} 98}
99 99
100static int iwl_add_sta_callback(struct iwl_priv *priv, 100static void iwl_add_sta_callback(struct iwl_priv *priv,
101 struct iwl_device_cmd *cmd, 101 struct iwl_device_cmd *cmd,
102 struct sk_buff *skb) 102 struct sk_buff *skb)
103{ 103{
104 struct iwl_rx_packet *res = NULL; 104 struct iwl_rx_packet *res = NULL;
105 struct iwl_addsta_cmd *addsta = 105 struct iwl_addsta_cmd *addsta =
@@ -108,14 +108,14 @@ static int iwl_add_sta_callback(struct iwl_priv *priv,
108 108
109 if (!skb) { 109 if (!skb) {
110 IWL_ERR(priv, "Error: Response NULL in REPLY_ADD_STA.\n"); 110 IWL_ERR(priv, "Error: Response NULL in REPLY_ADD_STA.\n");
111 return 1; 111 return;
112 } 112 }
113 113
114 res = (struct iwl_rx_packet *)skb->data; 114 res = (struct iwl_rx_packet *)skb->data;
115 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 115 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
116 IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n", 116 IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n",
117 res->hdr.flags); 117 res->hdr.flags);
118 return 1; 118 return;
119 } 119 }
120 120
121 switch (res->u.add_sta.status) { 121 switch (res->u.add_sta.status) {
@@ -127,9 +127,6 @@ static int iwl_add_sta_callback(struct iwl_priv *priv,
127 res->u.add_sta.status); 127 res->u.add_sta.status);
128 break; 128 break;
129 } 129 }
130
131 /* We didn't cache the SKB; let the caller free it */
132 return 1;
133} 130}
134 131
135int iwl_send_add_sta(struct iwl_priv *priv, 132int iwl_send_add_sta(struct iwl_priv *priv,
@@ -325,9 +322,9 @@ static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr)
325 spin_unlock_irqrestore(&priv->sta_lock, flags); 322 spin_unlock_irqrestore(&priv->sta_lock, flags);
326} 323}
327 324
328static int iwl_remove_sta_callback(struct iwl_priv *priv, 325static void iwl_remove_sta_callback(struct iwl_priv *priv,
329 struct iwl_device_cmd *cmd, 326 struct iwl_device_cmd *cmd,
330 struct sk_buff *skb) 327 struct sk_buff *skb)
331{ 328{
332 struct iwl_rx_packet *res = NULL; 329 struct iwl_rx_packet *res = NULL;
333 struct iwl_rem_sta_cmd *rm_sta = 330 struct iwl_rem_sta_cmd *rm_sta =
@@ -336,14 +333,14 @@ static int iwl_remove_sta_callback(struct iwl_priv *priv,
336 333
337 if (!skb) { 334 if (!skb) {
338 IWL_ERR(priv, "Error: Response NULL in REPLY_REMOVE_STA.\n"); 335 IWL_ERR(priv, "Error: Response NULL in REPLY_REMOVE_STA.\n");
339 return 1; 336 return;
340 } 337 }
341 338
342 res = (struct iwl_rx_packet *)skb->data; 339 res = (struct iwl_rx_packet *)skb->data;
343 if (res->hdr.flags & IWL_CMD_FAILED_MSK) { 340 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
344 IWL_ERR(priv, "Bad return from REPLY_REMOVE_STA (0x%08X)\n", 341 IWL_ERR(priv, "Bad return from REPLY_REMOVE_STA (0x%08X)\n",
345 res->hdr.flags); 342 res->hdr.flags);
346 return 1; 343 return;
347 } 344 }
348 345
349 switch (res->u.rem_sta.status) { 346 switch (res->u.rem_sta.status) {
@@ -354,9 +351,6 @@ static int iwl_remove_sta_callback(struct iwl_priv *priv,
354 IWL_ERR(priv, "REPLY_REMOVE_STA failed\n"); 351 IWL_ERR(priv, "REPLY_REMOVE_STA failed\n");
355 break; 352 break;
356 } 353 }
357
358 /* We didn't cache the SKB; let the caller free it */
359 return 1;
360} 354}
361 355
362static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr, 356static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr,