diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_hst.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_hst.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c index d1fa5bd6bdb..587d98ed098 100644 --- a/drivers/net/wireless/ath/ath9k/htc_hst.c +++ b/drivers/net/wireless/ath/ath9k/htc_hst.c | |||
@@ -146,7 +146,7 @@ static int htc_config_pipe_credits(struct htc_target *target) | |||
146 | struct htc_config_pipe_msg *cp_msg; | 146 | struct htc_config_pipe_msg *cp_msg; |
147 | int ret, time_left; | 147 | int ret, time_left; |
148 | 148 | ||
149 | skb = dev_alloc_skb(50 + sizeof(struct htc_frame_hdr)); | 149 | skb = alloc_skb(50 + sizeof(struct htc_frame_hdr), GFP_ATOMIC); |
150 | if (!skb) { | 150 | if (!skb) { |
151 | dev_err(target->dev, "failed to allocate send buffer\n"); | 151 | dev_err(target->dev, "failed to allocate send buffer\n"); |
152 | return -ENOMEM; | 152 | return -ENOMEM; |
@@ -174,7 +174,7 @@ static int htc_config_pipe_credits(struct htc_target *target) | |||
174 | 174 | ||
175 | return 0; | 175 | return 0; |
176 | err: | 176 | err: |
177 | dev_kfree_skb(skb); | 177 | kfree_skb(skb); |
178 | return -EINVAL; | 178 | return -EINVAL; |
179 | } | 179 | } |
180 | 180 | ||
@@ -184,7 +184,7 @@ static int htc_setup_complete(struct htc_target *target) | |||
184 | struct htc_comp_msg *comp_msg; | 184 | struct htc_comp_msg *comp_msg; |
185 | int ret = 0, time_left; | 185 | int ret = 0, time_left; |
186 | 186 | ||
187 | skb = dev_alloc_skb(50 + sizeof(struct htc_frame_hdr)); | 187 | skb = alloc_skb(50 + sizeof(struct htc_frame_hdr), GFP_ATOMIC); |
188 | if (!skb) { | 188 | if (!skb) { |
189 | dev_err(target->dev, "failed to allocate send buffer\n"); | 189 | dev_err(target->dev, "failed to allocate send buffer\n"); |
190 | return -ENOMEM; | 190 | return -ENOMEM; |
@@ -210,7 +210,7 @@ static int htc_setup_complete(struct htc_target *target) | |||
210 | return 0; | 210 | return 0; |
211 | 211 | ||
212 | err: | 212 | err: |
213 | dev_kfree_skb(skb); | 213 | kfree_skb(skb); |
214 | return -EINVAL; | 214 | return -EINVAL; |
215 | } | 215 | } |
216 | 216 | ||
@@ -250,8 +250,8 @@ int htc_connect_service(struct htc_target *target, | |||
250 | endpoint->dl_pipeid = service_to_dlpipe(service_connreq->service_id); | 250 | endpoint->dl_pipeid = service_to_dlpipe(service_connreq->service_id); |
251 | endpoint->ep_callbacks = service_connreq->ep_callbacks; | 251 | endpoint->ep_callbacks = service_connreq->ep_callbacks; |
252 | 252 | ||
253 | skb = dev_alloc_skb(sizeof(struct htc_conn_svc_msg) + | 253 | skb = alloc_skb(sizeof(struct htc_conn_svc_msg) + |
254 | sizeof(struct htc_frame_hdr)); | 254 | sizeof(struct htc_frame_hdr), GFP_ATOMIC); |
255 | if (!skb) { | 255 | if (!skb) { |
256 | dev_err(target->dev, "Failed to allocate buf to send" | 256 | dev_err(target->dev, "Failed to allocate buf to send" |
257 | "service connect req\n"); | 257 | "service connect req\n"); |
@@ -282,7 +282,7 @@ int htc_connect_service(struct htc_target *target, | |||
282 | *conn_rsp_epid = target->conn_rsp_epid; | 282 | *conn_rsp_epid = target->conn_rsp_epid; |
283 | return 0; | 283 | return 0; |
284 | err: | 284 | err: |
285 | dev_kfree_skb(skb); | 285 | kfree_skb(skb); |
286 | return ret; | 286 | return ret; |
287 | } | 287 | } |
288 | 288 | ||
@@ -321,7 +321,7 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle, | |||
321 | struct sk_buff *skb, bool txok) | 321 | struct sk_buff *skb, bool txok) |
322 | { | 322 | { |
323 | struct htc_endpoint *endpoint; | 323 | struct htc_endpoint *endpoint; |
324 | struct htc_frame_hdr *htc_hdr; | 324 | struct htc_frame_hdr *htc_hdr = NULL; |
325 | 325 | ||
326 | if (htc_handle->htc_flags & HTC_OP_CONFIG_PIPE_CREDITS) { | 326 | if (htc_handle->htc_flags & HTC_OP_CONFIG_PIPE_CREDITS) { |
327 | complete(&htc_handle->cmd_wait); | 327 | complete(&htc_handle->cmd_wait); |
@@ -349,7 +349,10 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle, | |||
349 | return; | 349 | return; |
350 | ret: | 350 | ret: |
351 | /* HTC-generated packets are freed here. */ | 351 | /* HTC-generated packets are freed here. */ |
352 | dev_kfree_skb_any(skb); | 352 | if (htc_hdr && htc_hdr->endpoint_id != ENDPOINT0) |
353 | dev_kfree_skb_any(skb); | ||
354 | else | ||
355 | kfree_skb(skb); | ||
353 | } | 356 | } |
354 | 357 | ||
355 | /* | 358 | /* |