[<prev] [next>] [day] [month] [year] [list]
Message-ID: <86496b3b336544f2b8f9d1932599a4af@qianxin.com>
Date: Tue, 12 Mar 2024 07:00:17 +0000
From: 柳菁峰 <liujingfeng@...nxin.com>
To: Z qiang <qiang.zhang1211@...il.com>
CC: "richardcochran@...il.com" <richardcochran@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"syzkaller@...glegroups.com" <syzkaller@...glegroups.com>,
"secalert@...hat.com" <secalert@...hat.com>
Subject: reply: memory leak in posix_clock_open
>
>Please try the following modifications:
>
>diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c index 9de66bbbb3d1..71d9d8c394fa 100644
>--- a/kernel/time/posix-clock.c
>+++ b/kernel/time/posix-clock.c
>@@ -137,6 +137,8 @@ static int posix_clock_open(struct inode *inode, struct file *fp)
>
> if (!err) {
> get_device(clk->dev);
>+ } else {
>+ kfree(pccontext);
> }
> out:
> up_read(&clk->rwsem);
I tested it, it was all right and fixed the memory leak.
Thanks.
Powered by blists - more mailing lists