Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88b386c0 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 7dd14525
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
}