ARM: PL08x: prevent dma_set_runtime_config() reconfiguring memcpy channels
authorRussell King - ARM Linux <linux@arm.linux.org.uk>
Mon, 3 Jan 2011 22:46:17 +0000 (22:46 +0000)
committerDan Williams <dan.j.williams@intel.com>
Wed, 5 Jan 2011 03:16:14 +0000 (19:16 -0800)
Prevent dma_set_runtime_config() being used to alter the configuration
supplied by the platform for memcpy channel configuration.  No one
should be trying to change this configuration.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/amba-pl08x.c

index c7f7b82f61557ddb2712dc56fda0164bbd87c1aa..bebc678ed4fc5dfd0e05850065c85d03db2e95e1 100644 (file)
@@ -1129,6 +1129,9 @@ static int dma_set_runtime_config(struct dma_chan *chan,
        u32 cctl = 0;
        int i;
 
+       if (!plchan->slave)
+               return -EINVAL;
+
        /* Transfer direction */
        plchan->runtime_direction = config->direction;
        if (config->direction == DMA_TO_DEVICE) {