[PATCH 2/2] watch_queue: Fix a memory leak

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

 



The 'notes_bitmap' is allocated in 'watch_queue_set_size()' but is never
released.
Free it when 'wqueue' and its other fields are freed.

Fixes: c73be61cede5 ("pipe: Add general notification queue support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
WARNING: This patch is certainly buggy because there is 'rcu'
consideration, but I've nothing better to propose.

It is maybe also completely buggy because freeing reference counted
resources is sometimes puzzling!

So review with care and update as needed (if needed :) )
---
 kernel/watch_queue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c
index 41ea30948c57..36c6822bec86 100644
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -372,6 +372,7 @@ static void __put_watch_queue(struct kref *kref)
 	wfilter = rcu_access_pointer(wqueue->filter);
 	if (wfilter)
 		kfree_rcu(wfilter, rcu);
+	bitmap_free(wqueue->notes_bitmap);
 	kfree_rcu(wqueue, rcu);
 }
 
-- 
2.30.2




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux