[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1360832420-6349-2-git-send-email-andriy.shevchenko@linux.intel.com>
Date: Thu, 14 Feb 2013 11:00:15 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Vinod Koul <vinod.koul@...el.com>, linux-kernel@...r.kernel.org,
Viresh Kumar <viresh.kumar@...aro.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v2 1/6] 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@...ux.intel.com>
Acked-by: Rob Herring <rob.herring@...xeda.com>
Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
---
drivers/dma/of-dma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index 59631b2..1ae6120 100644
--- a/drivers/dma/of-dma.c
+++ b/drivers/dma/of-dma.c
@@ -117,7 +117,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;
}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists