summaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmatest.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-10-21 20:42:20 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-10-21 20:42:20 +0200
commitb876d08f816527af257e13d89fb0d3b4b849223c (patch)
tree40569f568230f918ca55f04b355e251747f913ed /drivers/dma/dmatest.c
parentMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds... (diff)
parentbinfmt_elf_fdpic: Update for cputime changes. (diff)
downloadlinux-b876d08f816527af257e13d89fb0d3b4b849223c.tar.xz
linux-b876d08f816527af257e13d89fb0d3b4b849223c.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/pci/dmar.c
Diffstat (limited to 'drivers/dma/dmatest.c')
-rw-r--r--drivers/dma/dmatest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index a08d19704743..d1e381e35a9e 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -325,7 +325,12 @@ static enum dma_state_client dmatest_add_channel(struct dma_chan *chan)
struct dmatest_thread *thread;
unsigned int i;
- dtc = kmalloc(sizeof(struct dmatest_chan), GFP_ATOMIC);
+ /* Have we already been told about this channel? */
+ list_for_each_entry(dtc, &dmatest_channels, node)
+ if (dtc->chan == chan)
+ return DMA_DUP;
+
+ dtc = kmalloc(sizeof(struct dmatest_chan), GFP_KERNEL);
if (!dtc) {
pr_warning("dmatest: No memory for %s\n", chan->dev.bus_id);
return DMA_NAK;