Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 3/4] ath6kl: Initialize a variable properly
@ 2012-01-10  4:23 Sujith Manoharan
  2012-01-12 11:38 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Sujith Manoharan @ 2012-01-10  4:23 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

This prevents 'comp_pktq' from being used in an
incorrect manner.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/htc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index b017022..2d72190 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -2062,6 +2062,7 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target,
 	enum htc_endpoint_id id;
 	int n_fetched = 0;
 
+	INIT_LIST_HEAD(&comp_pktq);
 	*num_pkts = 0;
 
 	/*
-- 
1.7.8.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/4] ath6kl: Initialize a variable properly
  2012-01-10  4:23 [PATCH 3/4] ath6kl: Initialize a variable properly Sujith Manoharan
@ 2012-01-12 11:38 ` Kalle Valo
  2012-01-12 12:08   ` Sujith Manoharan
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2012-01-12 11:38 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: linux-wireless

On 01/10/2012 06:23 AM, Sujith Manoharan wrote:
> This prevents 'comp_pktq' from being used in an
> incorrect manner.
> 
> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath6kl/htc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
> index b017022..2d72190 100644
> --- a/drivers/net/wireless/ath/ath6kl/htc.c
> +++ b/drivers/net/wireless/ath/ath6kl/htc.c
> @@ -2062,6 +2062,7 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target,
>  	enum htc_endpoint_id id;
>  	int n_fetched = 0;
>  
> +	INIT_LIST_HEAD(&comp_pktq);


But there's also the same init later in the function, inside the while loop:

		INIT_LIST_HEAD(&rx_pktq);
		INIT_LIST_HEAD(&comp_pktq);

Is this intentional?

Kalle

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/4] ath6kl: Initialize a variable properly
  2012-01-12 11:38 ` Kalle Valo
@ 2012-01-12 12:08   ` Sujith Manoharan
  0 siblings, 0 replies; 3+ messages in thread
From: Sujith Manoharan @ 2012-01-12 12:08 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

Kalle Valo wrote:
> But there's also the same init later in the function, inside the while loop:
> 
> 		INIT_LIST_HEAD(&rx_pktq);
> 		INIT_LIST_HEAD(&comp_pktq);
> 
> Is this intentional?

I think so.

If we break out of the loop on the first iteration because of the condition
"if (id >= ENDPOINT_MAX)", then comp_pktq ends up being used without having
been initialized.

Sujith

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-12 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10  4:23 [PATCH 3/4] ath6kl: Initialize a variable properly Sujith Manoharan
2012-01-12 11:38 ` Kalle Valo
2012-01-12 12:08   ` Sujith Manoharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox