[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221107091424.dqlus2qdcsr2bmq3@sgarzare-redhat>
Date: Mon, 7 Nov 2022 10:14:24 +0100
From: Stefano Garzarella <sgarzare@...hat.com>
To: Jason Wang <jasowang@...hat.com>
Cc: ruanjinjie <ruanjinjie@...wei.com>, mst@...hat.com,
eperezma@...hat.com, gautam.dawar@...inx.com, elic@...dia.com,
virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] vdpa_sim: fix possible memory leak in vdpasim_net_init()
and vdpasim_blk_init()
On Mon, Nov 07, 2022 at 03:41:42PM +0800, Jason Wang wrote:
>On Fri, Nov 4, 2022 at 4:41 PM ruanjinjie <ruanjinjie@...wei.com> wrote:
>>
>> If device_register() returns error in vdpasim_net_init() or
>> vdpasim_blk_init(), name of kobject which is allocated in dev_set_name()
>> called in device_add() is leaked.
>>
>> As comment of device_add() says, it should call put_device() to drop
>> the reference count that was set in device_initialize() when it fails,
>> so the name can be freed in kobject_cleanup().
>>
>> Signed-off-by: ruanjinjie <ruanjinjie@...wei.com>
>
>Acked-by: Jason Wang <jasowang@...hat.com>
>
>Should we have a fixes tag and cc stable?
Yep, I think so.
The fixes tags should be:
Fixes: 899c4d187f6a ("vdpa_sim_blk: add support for vdpa management tool")
Fixes: a3c06ae158dd ("vdpa_sim_net: Add support for user supported devices")
With them:
Reviewed-by: Stefano Garzarella <sgarzare@...hat.com>
Thanks,
Stefano
Powered by blists - more mailing lists