The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH][next] fs: dlm: Fix memory leak of object mh
@ 2021-05-26 13:40 Colin King
  2021-05-26 14:19 ` Alexander Ahring Oder Aring
  2021-05-26 15:01 ` Dan Carpenter
  0 siblings, 2 replies; 7+ messages in thread
From: Colin King @ 2021-05-26 13:40 UTC (permalink / raw)
  To: Christine Caulfield, David Teigland, Alexander Aring,
	cluster-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

There is an error return path that is not kfree'ing mh after
it has been successfully allocates.  Fix this by free'ing it.

Addresses-Coverity: ("Resource leak")
Fixes: a070a91cf140 ("fs: dlm: add more midcomms hooks")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/dlm/rcom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/dlm/rcom.c b/fs/dlm/rcom.c
index 085f21966c72..19298edc1573 100644
--- a/fs/dlm/rcom.c
+++ b/fs/dlm/rcom.c
@@ -393,6 +393,7 @@ static void receive_rcom_lookup(struct dlm_ls *ls, struct dlm_rcom *rc_in)
 	if (rc_in->rc_id == 0xFFFFFFFF) {
 		log_error(ls, "receive_rcom_lookup dump from %d", nodeid);
 		dlm_dump_rsb_name(ls, rc_in->rc_buf, len);
+		kfree(mh);
 		return;
 	}
 
-- 
2.31.1


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

end of thread, other threads:[~2021-05-26 18:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-26 13:40 [PATCH][next] fs: dlm: Fix memory leak of object mh Colin King
2021-05-26 14:19 ` Alexander Ahring Oder Aring
2021-05-26 14:21   ` Colin Ian King
2021-05-26 15:01 ` Dan Carpenter
2021-05-26 15:11   ` Colin Ian King
2021-05-26 18:24     ` Dan Carpenter
2021-05-26 18:50       ` Alexander Ahring Oder Aring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox