Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: pl330: Initialize pl330 for pl330_prep_dma_memcpy after NULL check of pch

Currently pch pointer is already dereferenced before NULL check
and thus we are getting below warning:
warn: variable dereferenced before check 'pch'

So initialize struct pl330_dmac *pl330 after NULL check
of dma_pl330_chan *pch.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Reviewed-by: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Maninder Singh and committed by
Vinod Koul
f5636854 8f64b276

+3 -1
+3 -1
drivers/dma/pl330.c
··· 2581 2581 { 2582 2582 struct dma_pl330_desc *desc; 2583 2583 struct dma_pl330_chan *pch = to_pchan(chan); 2584 - struct pl330_dmac *pl330 = pch->dmac; 2584 + struct pl330_dmac *pl330; 2585 2585 int burst; 2586 2586 2587 2587 if (unlikely(!pch || !len)) 2588 2588 return NULL; 2589 + 2590 + pl330 = pch->dmac; 2589 2591 2590 2592 desc = __pl330_prep_dma_memcpy(pch, dst, src, len); 2591 2593 if (!desc)