* [PATCH] drivers, pch_dma: Fix uninitialized var before use
@ 2011-04-02 6:20 Liu Yuan
2011-04-06 8:45 ` Koul, Vinod
0 siblings, 1 reply; 2+ messages in thread
From: Liu Yuan @ 2011-04-02 6:20 UTC (permalink / raw)
To: Dan Williams, Vinod Koul; +Cc: open list
From: Liu Yuan <tailai.ly@taobao.com>
In the function pdc_desc_get(), var 'i' is not
initialized before use. This patch fixes it.
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
---
drivers/dma/pch_dma.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index 8d8fef1..6eebc62 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -403,7 +403,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan)
{
struct pch_dma_desc *desc, *_d;
struct pch_dma_desc *ret = NULL;
- int i;
+ int i = 0;
spin_lock(&pd_chan->lock);
list_for_each_entry_safe(desc, _d, &pd_chan->free_list, desc_node) {
--
1.7.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers, pch_dma: Fix uninitialized var before use
2011-04-02 6:20 [PATCH] drivers, pch_dma: Fix uninitialized var before use Liu Yuan
@ 2011-04-06 8:45 ` Koul, Vinod
0 siblings, 0 replies; 2+ messages in thread
From: Koul, Vinod @ 2011-04-06 8:45 UTC (permalink / raw)
To: Liu Yuan; +Cc: Dan Williams, open list
On Sat, 2011-04-02 at 14:20 +0800, Liu Yuan wrote:
> From: Liu Yuan <tailai.ly@taobao.com>
>
> In the function pdc_desc_get(), var 'i' is not
> initialized before use. This patch fixes it.
>
> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
> ---
> drivers/dma/pch_dma.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
> index 8d8fef1..6eebc62 100644
> --- a/drivers/dma/pch_dma.c
> +++ b/drivers/dma/pch_dma.c
> @@ -403,7 +403,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan)
> {
> struct pch_dma_desc *desc, *_d;
> struct pch_dma_desc *ret = NULL;
> - int i;
> + int i = 0;
>
> spin_lock(&pd_chan->lock);
> list_for_each_entry_safe(desc, _d, &pd_chan->free_list, desc_node) {
Applied, Thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-06 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-02 6:20 [PATCH] drivers, pch_dma: Fix uninitialized var before use Liu Yuan
2011-04-06 8:45 ` Koul, Vinod
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®