arm: davinci: fix edma dmaengine induced null pointer dereference on da830
Subsystems (3)
PATCH v2 1/1 arm: davinci: fix edma dmaengine induced null pointer dereference on da830
This adds additional error checking to the private edma api implementation to catch the case where the edma_alloc_slot() has an invalid controller parameter. The edma dmaengine wrapper driver relies on this condition being handled in order to avoid setting up a second edma dmaengine instance on DA830.
Verfied using a DA850 with the second EDMA controller platform instance removed to simulate a DA830 which only has a single EDMA controller.
---
v2: Move error check out of conditional to catch all cases
arch/arm/mach-davinci/dma.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-davinci/dma.c +3 -0
@@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);*/ int edma_alloc_slot (unsigned ctlr,int slot) { +if (!edma_cc[ctlr]) +return -EINVAL ; +if (slot >=0 ) slot =EDMA_CHAN_SLOT (slot);
Signature · 1 line
1.7.9.5
PATCH v2 1/1 arm: davinci: fix edma dmaengine induced null pointer dereference on da830
Quoted 23 lines · On Tue, 5 Mar 2013 10:58:22 -0500 Matt Porter <[email protected]> wrote:
This adds additional error checking to the private edma api implementation to catch the case where the
edma_alloc_slot()has an invalid controller parameter. The edma dmaengine wrapper driver relies on this condition being handled in order to avoid setting up a second edma dmaengine instance on DA830.Verfied using a DA850 with the second EDMA controller platform instance removed to simulate a DA830 which only has a single EDMA controller.
Reported-by Tomas Novotny <[email protected]>Signed-off-by Matt Porter <[email protected]>Cc stable at vger.kernel.org # v3.7.x+---
v2: Move error check out of conditional to catch all casesarch/arm/mach-davinci/dma.c | 3 +++ 1 file changed, 3 insertions(+)arch/arm/mach-davinci/dma.c +0
-0
arch/arm/mach-davinci/dma.c EXPORT_SYMBOL(edma_free_channel); · line 751
Quoted 9 lines
arch/arm/mach-davinci/dma.c +3
-0@@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);*/ int edma_alloc_slot (unsigned ctlr,int slot) { +if (!edma_cc[ctlr]) +return -EINVAL ; +if (slot >=0 ) slot =EDMA_CHAN_SLOT (slot);
On the TI AM1707 based custom board:
PATCH v2 1/1 arm: davinci: fix edma dmaengine induced null pointer dereference on da830
Quoted 38 lines · Tomas Novotny
Quoted 23 lines · On Tue, 5 Mar 2013 10:58:22 -0500 Matt Porter <[email protected]> wrote:
This adds additional error checking to the private edma api implementation to catch the case where the
edma_alloc_slot()has an invalid controller parameter. The edma dmaengine wrapper driver relies on this condition being handled in order to avoid setting up a second edma dmaengine instance on DA830.Verfied using a DA850 with the second EDMA controller platform instance removed to simulate a DA830 which only has a single EDMA controller.
Reported-by Tomas Novotny <[email protected]>Signed-off-by Matt Porter <[email protected]>Cc stable at vger.kernel.org # v3.7.x+---
v2: Move error check out of conditional to catch all casesarch/arm/mach-davinci/dma.c | 3 +++ 1 file changed, 3 insertions(+)arch/arm/mach-davinci/dma.c +0
-0arch/arm/mach-davinci/dma.c EXPORT_SYMBOL(edma_free_channel); · line 751
Quoted 9 lines
arch/arm/mach-davinci/dma.c +3
-0@@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);*/ int edma_alloc_slot (unsigned ctlr,int slot) { +if (!edma_cc[ctlr]) +return -EINVAL ; +if (slot >=0 ) slot =EDMA_CHAN_SLOT (slot);On the TI AM1707 based custom board:
Quoted 1 line
Tested-by Tomas Novotny <[email protected]>
I tested it on DA830 EVM. Queuing this for v3.9-rc
Thanks,
Sekhar