Re: is there a memleak in function pdcs_register_pathentries

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

 



Hello Lin Yi,

On 06.05.20 15:45, 亿一 wrote:
> I notice that most of the usage of kobject_init_and_add in drivers are
> wrong, and now some drivers code has maken it right,
> please see commit dfb5394f804e (https://lkml.org/lkml/2020/4/11/282).
>
> function pdcs_register_pathentries() in drivers/parisc/pdc_stable.c may
> have the similar issue and leak kobject.
> if kobject_init_and_add() failed, the entry->kobj  may already
> increased it's refcnt and allocated memory to store it's name,
> so a kobject_put is need before return.

Yes, you are correct. It's a possible leak.
Can you send a patch so I can apply it?

Helge




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux