[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210330104125.GP2542@lahna.fi.intel.com>
Date: Tue, 30 Mar 2021 13:41:25 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Andreas Noever <andreas.noever@...il.com>,
Kranthi Kuntala <kranthi.kuntala@...el.com>,
Michael Jamet <michael.jamet@...el.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, Jason Gunthorpe <jgg@...dia.com>
Subject: Re: [PATCH 1/2] thunderbolt: Fix a leak in tb_retimer_add()
On Mon, Mar 29, 2021 at 09:07:18AM +0300, Dan Carpenter wrote:
> After the device_register() succeeds, then the correct way to clean up
> is to call device_unregister(). The unregister calls both device_del()
> and device_put(). Since this code was only device_del() it results in
> a memory leak.
>
> Fixes: dacb12877d92 ("thunderbolt: Add support for on-board retimers")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
> This is from a new static checker warning. Not tested. With new
> warnings it's also possible that I have misunderstood something
> fundamental so review carefully etc.
>
> drivers/thunderbolt/retimer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Both patches applied to thunderbolt.git/fixes. Thanks Dan!
Powered by blists - more mailing lists