[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <689128702c77b331db90f5452ee94d6bc0654824.1638107850.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 28 Nov 2021 14:58:35 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: dhowells@...hat.com, lukas.bulwahn@...il.com
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH 2/2] watch_queue: Fix a memory leak
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@...adoo.fr>
---
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
Powered by blists - more mailing lists