EDMA: TI: fixed wrongly initialized data parameter to the edma callback
PATCH 2/2 EDMA: TI: fixed wrongly initialized data parameter to the edma callback
The "data" parameter passed indirectly to the edma_callback() should be edma_chan and not the dma_chan.
This bug was so far harmless since the offset of struct dma_chan within struct edma_chan is 0. However as soon as someone changes struct edma_chan this would cause troubles.
--- drivers/dma/edma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/edma.c +1 -1
@@ -813,7 +813,7 @@ static int edma_alloc_chan_resources(struct dma_chan *chan)LIST_HEAD (descs); a_ch_num =edma_alloc_channel (echan->ch_num, edma_callback, - chan,EVENTQ_DEFAULT ); + echan,EVENTQ_DEFAULT );if (a_ch_num <0 ) { ret = -ENODEV ;
Signature · 1 line
1.9.1
Quoted 6 lines · Petr Kulhavy
The "data" parameter passed indirectly to the
edma_callback()should beedma_chanand not thedma_chan.This bug was so far harmless since the offset of struct
dma_chanwithin structedma_chanis 0. However as soon as someone changes structedma_chanthis would cause troubles.
Good catch. This seams to be in the code since the first commit ;)
Quoted 19 lines
Signed-off-by Petr Kulhavy <[email protected]>--- drivers/dma/edma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dma/edma.c +1
-1@@ -813,7 +813,7 @@ static int edma_alloc_chan_resources(struct dma_chan *chan)LIST_HEAD (descs); a_ch_num =edma_alloc_channel (echan->ch_num, edma_callback, - chan,EVENTQ_DEFAULT ); + echan,EVENTQ_DEFAULT );if (a_ch_num <0 ) { ret = -ENODEV ;
Quoted 6 lines · Petr Kulhavy
The "data" parameter passed indirectly to the
edma_callback()should beedma_chanand not thedma_chan.This bug was so far harmless since the offset of struct
dma_chanwithin structedma_chanis 0. However as soon as someone changes structedma_chanthis would cause troubles.
Applied now, but do ensure you are using right subsystem anmes for patches. I have fixed up now
Signature · 1 line
~Vinod