ath10k: pci memleak fix
cover ath10k: pci memleak fix
By looking at the code I spotted a possible memleak. I haven't observed it yet but it seems it could happen. This patchset addresses it.
Patch #1 just removes code that is effectively a no-op. Patch #2 would touch the dead code.
Michal Kazior (3):
ath10k: drop dead code
ath10k: make htc cancellation a generic thing
ath10k: reorder pci shutdown sequences
drivers/net/wireless/ath/ath10k/core.h | 2 +- drivers/net/wireless/ath/ath10k/htc.c | 16 ++-------- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ----- drivers/net/wireless/ath/ath10k/htt_tx.c | 4 +-- drivers/net/wireless/ath/ath10k/pci.c | 50 ++++++++++++++++++------------ 5 files changed, 37 insertions(+), 42 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/3 ath10k: drop dead code
HTC RX could never be aborted.
--- drivers/net/wireless/ath/ath10k/htc.c | 10 ---------- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ------- 2 files changed, 17 deletions(-)
drivers/net/wireless/ath/ath10k/htc.c +0 -10
@@ -495,7 +495,6 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar,struct htc_target *target = ar->htc_handle;struct htc_hdr *hdr;struct htc_endpoint *ep; -struct ath10k_skb_cb *skb_cb;u16 payload_len;u32 trailer_len =0 ;u8 htc_ep_id;
@@ -607,15 +606,6 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, goto out; } -/* -* the current message based HIF architecture allocates net -* bufs for recv packets since this layer bridges that HIF to -* upper layers , which expects HTC packets, we form the -* packets here TODO_FIXME -*/ - skb_cb =ATH10K_SKB_CB (skb); - skb_cb->htc.cancelled = false; -ath10k_dbg (ATH10K_DBG_HTC ,"htc rx completion ep %d skb %p\n" , htc_ep_id, skb); ep->ep_callbacks.ep_rx_complete (ep->ep_callbacks.context, skb);
drivers/net/wireless/ath/ath10k/htt_rx.c +0 -7
@@ -950,15 +950,8 @@ end:void ath10k_htt_t2h_msg_handler (void *context,struct sk_buff *skb) {struct htt_struct *htt = (struct htt_struct *)context; -struct ath10k_skb_cb *skb_cb =ATH10K_SKB_CB (skb);struct htt_resp *resp = (struct htt_resp *)skb->data; -/* check for successful message reception */ -if (skb_cb->htc.cancelled) { -dev_kfree_skb_any (skb); -return ; - } -/* confirm alignment */ WARN_ON_ONCE ((((unsigned long )skb->data) &0x3 ) !=0 );
Signature · 1 line
1.7.9.5
PATCH 2/3 ath10k: make htc cancellation a generic thing
In reply to Michal KaziorWith this the HIF layer (e.g. PCI) can tell the upper layers that a packet was aborted and all related resources must be freed ASAP.
This makes sense for HTT TX in particular. FW requires us to allocate additional resources for each transmitted frame and we must not free those resources until after the whole thing is considered completed.
This is required to fix a possible memory leak in PCI CE teardown path.
--- drivers/net/wireless/ath/ath10k/core.h | 2 +- drivers/net/wireless/ath/ath10k/htc.c | 6 +++--- drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +1 -1
@@ -52,6 +52,7 @@ enum ath10k_bus {struct ath10k_skb_cb {dma_addr_t paddr;bool is_mapped; +bool is_aborted;struct {u8 vdev_id;
@@ -60,7 +61,6 @@ struct ath10k_skb_cb {struct {u8 credits_used; -bool cancelled;void (*complete)(struct sk_buff *);void *priv; } __packed htc;
drivers/net/wireless/ath/ath10k/htc.c +3 -3
@@ -193,7 +193,7 @@ err: ep->tx_credits += skb_cb->htc.credits_used;spin_unlock_bh (&target->htc_tx_lock); - skb_cb->htc.cancelled = true; + skb_cb->is_aborted = true;ath10k_htc_notify_tx_completion (ep, skb);return ret;
@@ -340,7 +340,7 @@ static int ath10k_htc_tx_completion_handler(struct ath10k *ar,struct htc_endpoint *ep = &target->endpoint[eid];struct ath10k_skb_cb *skb_cb =ATH10K_SKB_CB (skb); - skb_cb->htc.cancelled = false; + skb_cb->is_aborted = false;ath10k_htc_notify_tx_completion (ep, skb);/* the skb now belongs to the completion handler */
@@ -370,7 +370,7 @@ static void ath10k_htc_flush_endpoint_tx(struct htc_target *target,break ; skb_cb =ATH10K_SKB_CB (skb); - skb_cb->htc.cancelled = true; + skb_cb->is_aborted = true;ath10k_htc_notify_tx_completion (ep, skb); }spin_unlock_bh (&target->htc_tx_lock);
drivers/net/wireless/ath/ath10k/htt_tx.c +2 -2
@@ -243,7 +243,7 @@ static void ath10k_htt_mgmt_tx_htc_complete(struct sk_buff *skb) txi->htc_tx_completed = true; -if (skb_cb->htc.cancelled) { +if (skb_cb->is_aborted) {/* * if a packet gets cancelled we need to make sure * to free skbs since htt mgmt tx completion indication
@@ -332,7 +332,7 @@ static void ath10k_htt_tx_htc_complete(struct sk_buff *skb) txi->htc_tx_completed = true; -if (skb_cb->htc.cancelled) { +if (skb_cb->is_aborted) {/* * if a packet gets cancelled we need to make sure * to free skbs since htt mgmt tx completion indication
Signature · 1 line
1.7.9.5
PATCH 3/3 ath10k: reorder pci shutdown sequences
In reply to Michal KaziorIf a tx completion happened right before a CE pipe was stopped we'd free the completion related skbuff. If the skbuff was a part of HTT TX we'd leak memory and iommu mapping.
This shouldn't happen normally but if FW hangs or stalls and we unload the driver then we could memleak.
--- drivers/net/wireless/ath/ath10k/pci.c | 50 ++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +31 -19
@@ -775,10 +775,9 @@ static void ath10k_pci_start_ce(struct ath10k *ar)static void ath10k_pci_stop_ce (struct ath10k *ar) {struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); -struct hif_ce_completion_state *compl, *tmp; -struct hif_ce_pipe_info *pipe_info; -struct sk_buff *netbuf; -int i, pipe_num; +struct hif_ce_completion_state *compl; +struct sk_buff *skb; +int i;ath10k_ce_disable_interrupts (ar);
@@ -788,10 +787,29 @@ static void ath10k_pci_stop_ce(struct ath10k *ar)for (i =0 ; i <CE_COUNT_T (ar); i++)tasklet_kill (&ar_pci->pipe_info[i].intr); -/* -* Free pending completions. -*/ +/* Mark pending completions as aborted, so that upper layers free up +* their associated resources */ +spin_lock_bh (&ar_pci->compl_lock); +list_for_each_entry (compl, &ar_pci->compl_process, list) { + skb = (struct sk_buff *)compl->transfer_context; +ATH10K_SKB_CB (skb)->is_aborted = true; + } +spin_unlock_bh (&ar_pci->compl_lock); +} + +static void ath10k_pci_cleanup_ce (struct ath10k *ar) +{ +struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); +struct hif_ce_completion_state *compl, *tmp; +struct hif_ce_pipe_info *pipe_info; +struct sk_buff *netbuf; +int pipe_num; + +/* Free pending completions. */ spin_lock_bh (&ar_pci->compl_lock); +if (!list_empty (&ar_pci->compl_process)) +ath10k_warn ("pending completions still present! possible memory leaks.\n" ); +list_for_each_entry_safe (compl, tmp, &ar_pci->compl_process, list) {list_del (&compl->list); netbuf = (struct sk_buff *)compl->transfer_context;
@@ -800,9 +818,7 @@ static void ath10k_pci_stop_ce(struct ath10k *ar) }spin_unlock_bh (&ar_pci->compl_lock); -/* -* Free unused completions for each pipe. -*/ +/* Free unused completions for each pipe. */ for (pipe_num =0 ; pipe_num < ar_pci->ce_count; pipe_num++) { pipe_info = &ar_pci->pipe_info[pipe_num];
@@ -1155,19 +1171,15 @@ static void ath10k_pci_hif_stop(struct ath10k *ar) {ath10k_dbg (ATH10K_DBG_PCI ,"%s\n" , __func__); -/* sync shutdown */ ath10k_pci_stop_ce (ar); -ath10k_pci_process_ce (ar); -/* -* At this point, asynchronous threads are stopped, -* The Target should not DMA nor interrupt, Host code may -* not initiate anything more. So we just need to clean -* up Host-side state. -*/ +/* At this point, asynchronous threads are stopped, the target should +* not DMA nor interrupt. We process the leftovers and then free +* everything else up. */ +ath10k_pci_process_ce (ar); +ath10k_pci_cleanup_ce (ar);ath10k_pci_buffer_cleanup (ar); -ath10k_pci_ce_deinit (ar); }
Signature · 1 line
1.7.9.5
v2 cover ath10k: pci memleak fix
In reply to Michal KaziorThe v2 fixes patch 2, and introduces new patches 4 and 5. There were two possible memleaks.
Michal Kazior (5):
ath10k: drop dead code
ath10k: make HTC cancellation a generic thing
ath10k: fix HTC tx flushing
ath10k: reorder pci shutdown sequences
ath10k: fix memory leak during PCI teardown
drivers/net/wireless/ath/ath10k/core.h | 2 +- drivers/net/wireless/ath/ath10k/htc-priv.h | 2 ++ drivers/net/wireless/ath/ath10k/htc.c | 44 +++++++++--------------- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ---- drivers/net/wireless/ath/ath10k/htt_tx.c | 4 +-- drivers/net/wireless/ath/ath10k/pci.c | 51 +++++++++++++++++----------- 6 files changed, 53 insertions(+), 57 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v2 1/5 ath10k: drop dead code
HTC RX could never be aborted.
--- drivers/net/wireless/ath/ath10k/htc.c | 10 ---------- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 ------- 2 files changed, 17 deletions(-)
drivers/net/wireless/ath/ath10k/htc.c +0 -10
@@ -495,7 +495,6 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar,struct htc_target *target = ar->htc_handle;struct htc_hdr *hdr;struct htc_endpoint *ep; -struct ath10k_skb_cb *skb_cb;u16 payload_len;u32 trailer_len =0 ;u8 htc_ep_id;
@@ -607,15 +606,6 @@ static int ath10k_htc_rx_completion_handler(struct ath10k *ar, goto out; } -/* -* the current message based HIF architecture allocates net -* bufs for recv packets since this layer bridges that HIF to -* upper layers , which expects HTC packets, we form the -* packets here TODO_FIXME -*/ - skb_cb =ATH10K_SKB_CB (skb); - skb_cb->htc.cancelled = false; -ath10k_dbg (ATH10K_DBG_HTC ,"htc rx completion ep %d skb %p\n" , htc_ep_id, skb); ep->ep_callbacks.ep_rx_complete (ep->ep_callbacks.context, skb);
drivers/net/wireless/ath/ath10k/htt_rx.c +0 -7
@@ -950,15 +950,8 @@ end:void ath10k_htt_t2h_msg_handler (void *context,struct sk_buff *skb) {struct htt_struct *htt = (struct htt_struct *)context; -struct ath10k_skb_cb *skb_cb =ATH10K_SKB_CB (skb);struct htt_resp *resp = (struct htt_resp *)skb->data; -/* check for successful message reception */ -if (skb_cb->htc.cancelled) { -dev_kfree_skb_any (skb); -return ; - } -/* confirm alignment */ WARN_ON_ONCE ((((unsigned long )skb->data) &0x3 ) !=0 );
Signature · 1 line
1.7.9.5
PATCH v2 2/5 ath10k: make HTC cancellation a generic thing
In reply to Michal KaziorWith this the HIF layer (e.g. PCI) can tell the upper layers that a packet was aborted and all related resources must be freed ASAP.
This makes sense for HTT TX in particular. FW requires us to allocate additional resources for each transmitted frame and we must not free those resources until after the whole thing is considered completed.
This is required to fix a possible memory leak in PCI CE teardown path.
---
v2: prevent htc tx completion handler from
overwriting is_aborted
drivers/net/wireless/ath/ath10k/core.h | 2 +- drivers/net/wireless/ath/ath10k/htc.c | 5 ++--- drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +1 -1
@@ -52,6 +52,7 @@ enum ath10k_bus {struct ath10k_skb_cb {dma_addr_t paddr;bool is_mapped; +bool is_aborted;struct {u8 vdev_id;
@@ -60,7 +61,6 @@ struct ath10k_skb_cb {struct {u8 credits_used; -bool cancelled;void (*complete)(struct sk_buff *);void *priv; } __packed htc;
drivers/net/wireless/ath/ath10k/htc.c +2 -3
@@ -193,7 +193,7 @@ err: ep->tx_credits += skb_cb->htc.credits_used;spin_unlock_bh (&target->htc_tx_lock); - skb_cb->htc.cancelled = true; + skb_cb->is_aborted = true;ath10k_htc_notify_tx_completion (ep, skb);return ret;
@@ -340,7 +340,6 @@ static int ath10k_htc_tx_completion_handler(struct ath10k *ar,struct htc_endpoint *ep = &target->endpoint[eid];struct ath10k_skb_cb *skb_cb =ATH10K_SKB_CB (skb); - skb_cb->htc.cancelled = false;ath10k_htc_notify_tx_completion (ep, skb);/* the skb now belongs to the completion handler */
@@ -370,7 +369,7 @@ static void ath10k_htc_flush_endpoint_tx(struct htc_target *target,break ; skb_cb =ATH10K_SKB_CB (skb); - skb_cb->htc.cancelled = true; + skb_cb->is_aborted = true;ath10k_htc_notify_tx_completion (ep, skb); }spin_unlock_bh (&target->htc_tx_lock);
drivers/net/wireless/ath/ath10k/htt_tx.c +2 -2
@@ -243,7 +243,7 @@ static void ath10k_htt_mgmt_tx_htc_complete(struct sk_buff *skb) txi->htc_tx_completed = true; -if (skb_cb->htc.cancelled) { +if (skb_cb->is_aborted) {/* * if a packet gets cancelled we need to make sure * to free skbs since htt mgmt tx completion indication
@@ -332,7 +332,7 @@ static void ath10k_htt_tx_htc_complete(struct sk_buff *skb) txi->htc_tx_completed = true; -if (skb_cb->htc.cancelled) { +if (skb_cb->is_aborted) {/* * if a packet gets cancelled we need to make sure * to free skbs since htt mgmt tx completion indication
Signature · 1 line
1.7.9.5
PATCH v2 3/5 ath10k: fix HTC tx flushing
In reply to Michal KaziorThere was a very slight chance we'd pass a single
frame while stopping HTC.
--- drivers/net/wireless/ath/ath10k/htc-priv.h | 2 ++ drivers/net/wireless/ath/ath10k/htc.c | 29 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath10k/htc-priv.h +2 -0
@@ -264,6 +264,8 @@ struct htc_target {int total_transmit_credits;struct htc_service_tx_creadit_alloc service_tx_alloc[HTC_EP_COUNT ];int target_credit_size; + + bool stopping; };#endif /* _HTC_PRIV_H_ */
drivers/net/wireless/ath/ath10k/htc.c +14 -15
@@ -339,11 +339,16 @@ static int ath10k_htc_tx_completion_handler(struct ath10k *ar,struct htc_target *target = ar->htc_handle;struct htc_endpoint *ep = &target->endpoint[eid];struct ath10k_skb_cb *skb_cb =ATH10K_SKB_CB (skb); +bool stopping;ath10k_htc_notify_tx_completion (ep, skb);/* the skb now belongs to the completion handler */ -if (!ep->tx_credit_flow_enabled) +spin_lock_bh (&target->htc_tx_lock); + stopping = target->stopping; +spin_unlock_bh (&target->htc_tx_lock); + +if (!ep->tx_credit_flow_enabled && !stopping)/* * note: when using TX credit flow, the re-checking of * queues happens when credits flow back from the target.
@@ -373,6 +378,8 @@ static void ath10k_htc_flush_endpoint_tx(struct htc_target *target,ath10k_htc_notify_tx_completion (ep, skb); }spin_unlock_bh (&target->htc_tx_lock); + +cancel_work_sync (&ep->send_work); }/***********/
@@ -642,6 +649,8 @@ static void ath10k_htc_reset_endpoint_states(struct htc_target *target) ep->tx_queue_len =0 ; ep->target = target; ep->tx_credit_flow_enabled = true; +INIT_WORK (&ep->send_work, ath10k_htc_send_work); + } }
@@ -870,8 +879,6 @@ int ath10k_htc_connect_service(struct htc_target *target,if (ep->service_id !=HTC_SVC_UNUSED )return -EPROTO ; -INIT_WORK (&ep->send_work, ath10k_htc_send_work); -/* return assigned endpoint to caller */ connect_resp->ep_id = assigned_ep; connect_resp->max_msg_len =__le16_to_cpu (resp_msg->max_msg_size);
@@ -968,24 +975,16 @@ void ath10k_htc_stop(struct htc_target *target)int i;struct htc_endpoint *ep; -/* cleanup endpoints */ +spin_lock_bh (&target->htc_tx_lock); + target->stopping = true; +spin_unlock_bh (&target->htc_tx_lock); +for (i =HTC_EP_0 ; i <HTC_EP_COUNT ; i++) { ep = &target->endpoint[i];ath10k_htc_flush_endpoint_tx (target, ep); }ath10k_hif_stop (target->ar); - -/* ath10k_pci_buffer_cleanup may schedule ath10k_htc_send */ -for (i =HTC_EP_0 ; i <HTC_EP_COUNT ; i++) { - ep = &target->endpoint[i]; - -if (ep->service_id ==HTC_SVC_UNUSED ) -continue ; - -cancel_work_sync (&ep->send_work); - } -ath10k_htc_reset_endpoint_states (target); }
Signature · 1 line
1.7.9.5
PATCH v2 4/5 ath10k: reorder pci shutdown sequences
In reply to Michal KaziorIf a tx completion happened right before a CE pipe was stopped we'd free the completion related skbuff. If the skbuff was a part of HTT TX we'd leak memory and iommu mapping.
This shouldn't happen normally but if FW hangs or stalls and we unload the driver then we could memleak.
--- drivers/net/wireless/ath/ath10k/pci.c | 50 ++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +31 -19
@@ -775,10 +775,9 @@ static void ath10k_pci_start_ce(struct ath10k *ar)static void ath10k_pci_stop_ce (struct ath10k *ar) {struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); -struct hif_ce_completion_state *compl, *tmp; -struct hif_ce_pipe_info *pipe_info; -struct sk_buff *netbuf; -int i, pipe_num; +struct hif_ce_completion_state *compl; +struct sk_buff *skb; +int i;ath10k_ce_disable_interrupts (ar);
@@ -788,10 +787,29 @@ static void ath10k_pci_stop_ce(struct ath10k *ar)for (i =0 ; i <CE_COUNT_T (ar); i++)tasklet_kill (&ar_pci->pipe_info[i].intr); -/* -* Free pending completions. -*/ +/* Mark pending completions as aborted, so that upper layers free up +* their associated resources */ +spin_lock_bh (&ar_pci->compl_lock); +list_for_each_entry (compl, &ar_pci->compl_process, list) { + skb = (struct sk_buff *)compl->transfer_context; +ATH10K_SKB_CB (skb)->is_aborted = true; + } +spin_unlock_bh (&ar_pci->compl_lock); +} + +static void ath10k_pci_cleanup_ce (struct ath10k *ar) +{ +struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); +struct hif_ce_completion_state *compl, *tmp; +struct hif_ce_pipe_info *pipe_info; +struct sk_buff *netbuf; +int pipe_num; + +/* Free pending completions. */ spin_lock_bh (&ar_pci->compl_lock); +if (!list_empty (&ar_pci->compl_process)) +ath10k_warn ("pending completions still present! possible memory leaks.\n" ); +list_for_each_entry_safe (compl, tmp, &ar_pci->compl_process, list) {list_del (&compl->list); netbuf = (struct sk_buff *)compl->transfer_context;
@@ -800,9 +818,7 @@ static void ath10k_pci_stop_ce(struct ath10k *ar) }spin_unlock_bh (&ar_pci->compl_lock); -/* -* Free unused completions for each pipe. -*/ +/* Free unused completions for each pipe. */ for (pipe_num =0 ; pipe_num < ar_pci->ce_count; pipe_num++) { pipe_info = &ar_pci->pipe_info[pipe_num];
@@ -1155,19 +1171,15 @@ static void ath10k_pci_hif_stop(struct ath10k *ar) {ath10k_dbg (ATH10K_DBG_PCI ,"%s\n" , __func__); -/* sync shutdown */ ath10k_pci_stop_ce (ar); -ath10k_pci_process_ce (ar); -/* -* At this point, asynchronous threads are stopped, -* The Target should not DMA nor interrupt, Host code may -* not initiate anything more. So we just need to clean -* up Host-side state. -*/ +/* At this point, asynchronous threads are stopped, the target should +* not DMA nor interrupt. We process the leftovers and then free +* everything else up. */ +ath10k_pci_process_ce (ar); +ath10k_pci_cleanup_ce (ar);ath10k_pci_buffer_cleanup (ar); -ath10k_pci_ce_deinit (ar); }
Signature · 1 line
1.7.9.5
PATCH v2 5/5 ath10k: fix memory leak during PCI teardown
In reply to Michal KaziorIf we force-complete a tx skbuff we must mark it
as aborted.
If we don't do that we might free a HTT TX skbuff
that was not HTT TX completed.
This was easily triggered with:
* run iperf
* eject the device
* (if necessary) force remove it with sysfs
--- drivers/net/wireless/ath/ath10k/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath10k/pci.c +1 -0
@@ -1123,6 +1123,7 @@ static void ath10k_pci_send_buffer_cleanup_on_pipe(struct hif_ce_pipe_info *pipe* Indicate the completion to higer layer to free * the buffer */ +ATH10K_SKB_CB (netbuf)->is_aborted = true; ar_pci->msg_callbacks_current.tx_completion_handler ( ar, netbuf, id); }
Signature · 1 line
1.7.9.5
v2 cover ath10k: pci memleak fix
In reply to Michal KaziorQuoted 9 lines · Michal Kazior
The v2 fixes patch 2, and introduces new patches 4 and 5. There were two possible memleaks.
Michal Kazior (5):
ath10k: drop dead code
ath10k: make HTC cancellation a generic thing
ath10k: fix HTC tx flushing
ath10k: reorder pci shutdown sequences
ath10k: fix memory leak during PCI teardown
Thanks, all five applied.
Signature · 1 line
Kalle Valo
v2 cover ath10k: pci memleak fix
Quoted 5 lines · Kalle Valo
Quoted 3 lines · Michal Kazior
The v2 fixes patch 2, and introduces new patches 4 and 5. There were two possible memleaks.
Quoted 8 lines
Quoted 6 lines
Michal Kazior (5):
ath10k: drop dead code
ath10k: make HTC cancellation a generic thing
ath10k: fix HTC tx flushing
ath10k: reorder pci shutdown sequences
ath10k: fix memory leak during PCI teardownThanks, all five applied.
I'm not sure, but I suspect this set added a new warning:
drivers/net/wireless/ath/ath10k/htc.c:341:24: warning: unused variable skb_cb [-Wunused-variable]
Signature · 1 line
Kalle Valo
v2 cover ath10k: pci memleak fix
Quoted 14 lines · Kalle Valo
Quoted 12 lines · Kalle Valo
Quoted 9 lines · Michal Kazior
The v2 fixes patch 2, and introduces new patches 4 and 5. There were two possible memleaks.
Michal Kazior (5):
ath10k: drop dead code
ath10k: make HTC cancellation a generic thing
ath10k: fix HTC tx flushing
ath10k: reorder pci shutdown sequences
ath10k: fix memory leak during PCI teardown
Quoted 5 lines
Quoted 1 line
Thanks, all five applied.
I'm not sure, but I suspect this set added a new warning:
drivers/net/wireless/ath/ath10k/htc.c:341:24: warning: unused variableskb_cb[-Wunused-variable]
Yes. My apologies. I must've missed that somehow. It was introduced by patch #2.
-- Pozdrawiam / Best regards, Michal Kazior.
v2 cover ath10k: pci memleak fix
Quoted 15 lines · Michal Kazior
Quoted 14 lines · Kalle Valo
Quoted 12 lines · Kalle Valo
Quoted 9 lines · Michal Kazior
The v2 fixes patch 2, and introduces new patches 4 and 5. There were two possible memleaks.
Michal Kazior (5):
ath10k: drop dead code
ath10k: make HTC cancellation a generic thing
ath10k: fix HTC tx flushing
ath10k: reorder pci shutdown sequences
ath10k: fix memory leak during PCI teardown
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Thanks, all five applied.
I'm not sure, but I suspect this set added a new warning:
drivers/net/wireless/ath/ath10k/htc.c:341:24: warning: unused variableskb_cb[-Wunused-variable]Yes. My apologies. I must've missed that somehow. It was introduced by patch #2.
No worries. Can you send a followup patch to fix that, please?
Signature · 1 line
Kalle Valo
PATCH 1/1 ath10k: fix unused variable warning
--- drivers/net/wireless/ath/ath10k/htc.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/ath/ath10k/htc.c +0 -1
@@ -337,7 +337,6 @@ static int ath10k_htc_tx_completion_handler(struct ath10k *ar, {struct ath10k_htc *htc = ar->htc;struct ath10k_htc_ep *ep = &htc->endpoint[eid]; -struct ath10k_skb_cb *skb_cb =ATH10K_SKB_CB (skb);bool stopping;ath10k_htc_notify_tx_completion (ep, skb);
Signature · 1 line
1.7.9.5
Kalle Valo
AppliedPATCH 1/1 ath10k: fix unused variable warning
Quoted 1 line · Michal Kazior
Signed-off-by Michal Kazior <[email protected]>
Thanks, applied. I just added the function name to the title.
Signature · 1 line
Kalle Valo
cover ath10k: pci memleak fix
In reply to Michal KaziorQuoted 11 lines · Michal Kazior
By looking at the code I spotted a possible memleak. I haven't observed it yet but it seems it could happen. This patchset addresses it.
Patch #1 just removes code that is effectively a no-op. Patch #2 would touch the dead code.
Michal Kazior (3):
ath10k: drop dead code
ath10k: make htc cancellation a generic thing
ath10k: reorder pci shutdown sequences
Skipping this as there's v2.
(This is just for my own bookkeping :)
Signature · 1 line
Kalle Valo