diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-02-14 04:00:15 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-02-14 09:30:53 -0500 |
commit | 88b386c0a7c278581d2b8e2c2761d12f6475938d (patch) | |
tree | b4616aeeb7a8c5c057cd52d30a2ecadb744d6f1f /drivers/dma/of-dma.c | |
parent | 7dd145252574e34d92ad574e5168e4115639c0be (diff) |
dma: of-dma: protect list write operation by spin_lock
It's possible to have an inconsistency in the list due to unprotected operation
on it. The patch adds a proper locking on the list operation.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/of-dma.c')
-rw-r--r-- | drivers/dma/of-dma.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index 583e50e3d47c..69d04d28b1ef 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c | |||
@@ -118,7 +118,9 @@ int of_dma_controller_register(struct device_node *np, | |||
118 | ofdma->use_count = 0; | 118 | ofdma->use_count = 0; |
119 | 119 | ||
120 | /* Now queue of_dma controller structure in list */ | 120 | /* Now queue of_dma controller structure in list */ |
121 | spin_lock(&of_dma_lock); | ||
121 | list_add_tail(&ofdma->of_dma_controllers, &of_dma_list); | 122 | list_add_tail(&ofdma->of_dma_controllers, &of_dma_list); |
123 | spin_unlock(&of_dma_lock); | ||
122 | 124 | ||
123 | return 0; | 125 | return 0; |
124 | } | 126 | } |