Re: [PATCH] Fix reference count leak in pci_create_slot

2020-07-10 Thread Bjorn Helgaas
On Wed, May 27, 2020 at 09:13:22PM -0500, wu000...@umn.edu wrote: > From: Qiushi Wu > > kobject_init_and_add() takes reference even when it fails. > If this function returns an error, kobject_put() must be called to > properly clean up the memory associated with the object. Thus, > when call of k

[PATCH] Fix reference count leak in pci_create_slot

2020-05-27 Thread wu000273
From: Qiushi Wu kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Thus, when call of kobject_init_and_add() fail, we should call kobject_put() instead of kfree(). P