linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: ti: knav_qmss_queue: Use list_for_each_entry_safe to prevent use after free
@ 2014-11-01  5:33 Axel Lin
  2014-11-03 18:27 ` santosh.shilimkar@oralce.com
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-11-01  5:33 UTC (permalink / raw)
  To: linux-arm-kernel

list_for_each_entry_safe() is necessary if list objects are deleted from
the list while traversing it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/soc/ti/knav_qmss_queue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 6f22d56..9b8dd67 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1306,14 +1306,14 @@ static void knav_free_queue_ranges(struct knav_device *kdev)
 static void knav_queue_free_regions(struct knav_device *kdev)
 {
 	struct knav_region *region;
-	struct knav_pool *pool;
+	struct knav_pool *pool, *tmp;
 	unsigned size;
 
 	for (;;) {
 		region = first_region(kdev);
 		if (!region)
 			break;
-		list_for_each_entry(pool, &region->pools, region_inst)
+		list_for_each_entry_safe(pool, tmp, &region->pools, region_inst)
 			knav_pool_destroy(pool);
 
 		size = region->virt_end - region->virt_start;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] soc: ti: knav_qmss_queue: Use list_for_each_entry_safe to prevent use after free
  2014-11-01  5:33 [PATCH] soc: ti: knav_qmss_queue: Use list_for_each_entry_safe to prevent use after free Axel Lin
@ 2014-11-03 18:27 ` santosh.shilimkar@oralce.com
  0 siblings, 0 replies; 2+ messages in thread
From: santosh.shilimkar@oralce.com @ 2014-11-03 18:27 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/31/2014 10:33 PM, Axel Lin wrote:
> list_for_each_entry_safe() is necessary if list objects are deleted from
> the list while traversing it.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---

Right. Picked up for 3.19. Thanks !!

Regards,
Santosh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-03 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-01  5:33 [PATCH] soc: ti: knav_qmss_queue: Use list_for_each_entry_safe to prevent use after free Axel Lin
2014-11-03 18:27 ` santosh.shilimkar@oralce.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).