mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Acked-by: Rob Herring <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
This commit is contained in:
parent
7dd1452525
commit
88b386c0a7
1 changed files with 2 additions and 0 deletions
|
|
@ -118,7 +118,9 @@ int of_dma_controller_register(struct device_node *np,
|
|||
ofdma->use_count = 0;
|
||||
|
||||
/* Now queue of_dma controller structure in list */
|
||||
spin_lock(&of_dma_lock);
|
||||
list_add_tail(&ofdma->of_dma_controllers, &of_dma_list);
|
||||
spin_unlock(&of_dma_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue