Re: [PATCH -next 1/2] kobject: fix memory leak in kset_register() due to uninitialized kset->kobj.ktype

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 25, 2024 at 08:07:46PM +0800, Gaosheng Cui wrote:
> If a kset with uninitialized kset->kobj.ktype be registered,

Does that happen today with any in-kernel code?  If so, let's fix those
kset instances, right?

> kset_register() will return error, and the kset.kobj.name allocated
> by kobject_set_name() will be leaked.
> 
> To mitigate this, we free the name in kset_register() when an error
> is encountered due to uninitialized kset->kobj.ktype.

How did you hit this?

thanks,

greg k-h




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux