dmaengine: Use Pointer xt after NULL check.
Subsystems (2)
PATCH 1/1 dmaengine: Use Pointer xt after NULL check.
Removing static analysis error:-
Possible null pointer dereference: xt
Because currently xt is dereferenced before NULL check, Thus Use it after NULL Check.
Signed-off-by Maninder Singh <[email protected]>
Reviewed-by Vaneet Narang <[email protected]>
--- drivers/dma/at_hdmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/at_hdmac.c +3 -3
@@ -659,14 +659,14 @@ atc_prep_dma_interleaved(struct dma_chan *chan,size_t len =0 ;int i; +if (unlikely (!xt || xt->numf !=1 || !xt->frame_size)) +return NULL ; +dev_info (chan2dev (chan),"%s: src=0x%08x, dest=0x%08x, numf=%d, frame_size=%d, flags=0x%lx\n" , __func__, xt->src_start, xt->dst_start, xt->numf, xt->frame_size, flags); -if (unlikely (!xt || xt->numf !=1 || !xt->frame_size)) -return NULL ; -/* * The controller can only "skip" X bytes every Y bytes, so we * need to make sure we are given a template that fit that
Signature · 1 line
1.7.9.5
PATCH 1/1 dmaengine: Use Pointer xt after NULL check.
Le 26/06/2015 12:34, Maninder Singh a ?crit :
Quoted 8 lines
Removing static analysis error:-
Possible null pointer dereference: xtBecause currently xt is dereferenced before NULL check, Thus Use it after NULL Check.
Signed-off-by Maninder Singh <[email protected]>Reviewed-by Vaneet Narang <[email protected]>
Ok:
Acked-by Nicolas Ferre <[email protected]>
Quoted 27 lines
--- drivers/dma/at_hdmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/dma/at_hdmac.c +3
-3@@ -659,14 +659,14 @@ atc_prep_dma_interleaved(struct dma_chan *chan,size_t len =0 ;int i; +if (unlikely (!xt || xt->numf !=1 || !xt->frame_size)) +return NULL ; +dev_info (chan2dev (chan),"%s: src=0x%08x, dest=0x%08x, numf=%d, frame_size=%d, flags=0x%lx\n" , __func__, xt->src_start, xt->dst_start, xt->numf, xt->frame_size, flags); -if (unlikely (!xt || xt->numf !=1 || !xt->frame_size)) -return NULL ; -/* * The controller can only "skip" X bytes every Y bytes, so we * need to make sure we are given a template that fit that
Signature · 1 line
Nicolas Ferre
Vinod Koul
AppliedPATCH 1/1 dmaengine: Use Pointer xt after NULL check.
In reply to Maninder SinghQuoted 6 lines · Maninder Singh
Removing static analysis error:-
Possible null pointer dereference: xtBecause currently xt is dereferenced before NULL check, Thus Use it after NULL Check.
Applied, thanks
Signature · 1 line
~Vinod