[PATCH] interconnect: Add locking in icc_set_tag()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We must ensure that the tag is not changed while we aggregate the
requests. Currently the icc_set_tag() is not using any locks and this
may cause the values to be aggregated incorrectly. Fix this by acquiring
the icc_lock while we set the tag.

Fixes: 127ab2cc5f19 ("interconnect: Add support for path tags")
Signed-off-by: Georgi Djakov <georgi.djakov@xxxxxxxxxx>
---
 drivers/interconnect/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index e24092558c29..4940c0741d40 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -408,8 +408,12 @@ void icc_set_tag(struct icc_path *path, u32 tag)
 	if (!path)
 		return;
 
+	mutex_lock(&icc_lock);
+
 	for (i = 0; i < path->num_nodes; i++)
 		path->reqs[i].tag = tag;
+
+	mutex_unlock(&icc_lock);
 }
 EXPORT_SYMBOL_GPL(icc_set_tag);
 



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux