projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
532d3b1
)
dmaengine: protect 'id' from concurrent registrations
author
Dan Williams
<dan.j.williams@intel.com>
Thu, 4 Dec 2008 00:17:07 +0000
(17:17 -0700)
committer
Dan Williams
<dan.j.williams@intel.com>
Thu, 4 Dec 2008 00:25:36 +0000
(17:25 -0700)
There is a possibility to have two devices registered with the same id.
Cc: <stable@kernel.org>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/dmaengine.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/dma/dmaengine.c
b/drivers/dma/dmaengine.c
index 5317e08221ecb2a34e699c77bac4f72a505f59e6..657996517374f30f51f10257dd0ef0ee40ae66b9 100644
(file)
--- a/
drivers/dma/dmaengine.c
+++ b/
drivers/dma/dmaengine.c
@@
-388,7
+388,10
@@
int dma_async_device_register(struct dma_device *device)
init_completion(&device->done);
kref_init(&device->refcount);
+
+ mutex_lock(&dma_list_mutex);
device->dev_id = id++;
+ mutex_unlock(&dma_list_mutex);
/* represent channels in sysfs. Probably want devs too */
list_for_each_entry(chan, &device->channels, device_node) {