Skip to contentSkip to conversation

drivers, pch_dma: Fix uninitialized var before use

PATCH Applied Liu Yuan 2 participants 2 messages Apr 2, 2011 – Apr 6, 2011 dmaengine

lore
Share & tools
lore

Liu Yuan

author
#0 lore raw

PATCH 1/1 drivers, pch_dma: Fix uninitialized var before use

From: Liu Yuan <[email protected]>

In the function pdc_desc_get(), var 'i' is not
initialized before use. This patch fixes it.

---
 drivers/dma/pch_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/pch_dma.c +1 -1
index 8d8fef1..6eebc62 100644
@@ -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) {
Signature · 1 line
1.7.1
Applied
#1 lore raw
Quoted 15 lines · Liu Yuan

From: Liu Yuan <[email protected]>

In the function pdc_desc_get(), var 'i' is not
initialized before use. This patch fixes it.

---
 drivers/dma/pch_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/pch_dma.c +0 -0
index 8d8fef1..6eebc62 100644

drivers/dma/pch_dma.c static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan) · line 409

Quoted 8 lines
drivers/dma/pch_dma.c +1 -1
@@ -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

Signature · 1 line
~Vinod