aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-hcmd.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-hcmd.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-hcmd.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-hcmd.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
index d8a3eac8ceb7..b82ad15d5189 100644
--- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
@@ -103,23 +103,23 @@ EXPORT_SYMBOL(get_cmd_string);
103 103
104#define HOST_COMPLETE_TIMEOUT (HZ / 2) 104#define HOST_COMPLETE_TIMEOUT (HZ / 2)
105 105
106static int iwl_generic_cmd_callback(struct iwl_priv *priv, 106static void iwl_generic_cmd_callback(struct iwl_priv *priv,
107 struct iwl_device_cmd *cmd, 107 struct iwl_device_cmd *cmd,
108 struct sk_buff *skb) 108 struct sk_buff *skb)
109{ 109{
110 struct iwl_rx_packet *pkt = NULL; 110 struct iwl_rx_packet *pkt = NULL;
111 111
112 if (!skb) { 112 if (!skb) {
113 IWL_ERR(priv, "Error: Response NULL in %s.\n", 113 IWL_ERR(priv, "Error: Response NULL in %s.\n",
114 get_cmd_string(cmd->hdr.cmd)); 114 get_cmd_string(cmd->hdr.cmd));
115 return 1; 115 return;
116 } 116 }
117 117
118 pkt = (struct iwl_rx_packet *)skb->data; 118 pkt = (struct iwl_rx_packet *)skb->data;
119 if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) { 119 if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) {
120 IWL_ERR(priv, "Bad return from %s (0x%08X)\n", 120 IWL_ERR(priv, "Bad return from %s (0x%08X)\n",
121 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags); 121 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
122 return 1; 122 return;
123 } 123 }
124 124
125#ifdef CONFIG_IWLWIFI_DEBUG 125#ifdef CONFIG_IWLWIFI_DEBUG
@@ -128,15 +128,12 @@ static int iwl_generic_cmd_callback(struct iwl_priv *priv,
128 case SENSITIVITY_CMD: 128 case SENSITIVITY_CMD:
129 IWL_DEBUG_HC_DUMP(priv, "back from %s (0x%08X)\n", 129 IWL_DEBUG_HC_DUMP(priv, "back from %s (0x%08X)\n",
130 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags); 130 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
131 break; 131 break;
132 default: 132 default:
133 IWL_DEBUG_HC(priv, "back from %s (0x%08X)\n", 133 IWL_DEBUG_HC(priv, "back from %s (0x%08X)\n",
134 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags); 134 get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
135 } 135 }
136#endif 136#endif
137
138 /* Let iwl_tx_complete free the response skb */
139 return 1;
140} 137}
141 138
142static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd) 139static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
@@ -275,9 +272,9 @@ EXPORT_SYMBOL(iwl_send_cmd_pdu);
275 272
276int iwl_send_cmd_pdu_async(struct iwl_priv *priv, 273int iwl_send_cmd_pdu_async(struct iwl_priv *priv,
277 u8 id, u16 len, const void *data, 274 u8 id, u16 len, const void *data,
278 int (*callback)(struct iwl_priv *priv, 275 void (*callback)(struct iwl_priv *priv,
279 struct iwl_device_cmd *cmd, 276 struct iwl_device_cmd *cmd,
280 struct sk_buff *skb)) 277 struct sk_buff *skb))
281{ 278{
282 struct iwl_host_cmd cmd = { 279 struct iwl_host_cmd cmd = {
283 .id = id, 280 .id = id,