On Fri, Nov 4, 2022 at 4:41 PM ruanjinjie <ruanjinjie@xxxxxxxxxx> 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@xxxxxxxxxx>
Acked-by: Jason Wang <jasowang@xxxxxxxxxx>
Should we have a fixes tag and cc stable?