* Re: [PATCH] PCI: Fix reference count leak in pci_create_slot()
@ 2020-05-29 5:45 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2020-05-29 5:45 UTC (permalink / raw)
To: Qiushi Wu, linux-pci
Cc: kernel-janitors, linux-kernel, Alex Chiang, Bjorn Helgaas,
Jesse Barnes, Kangjie Lu, Kenji Kaneshige
Please add a prefix to the patch subject.
> kobject_init_and_add() takes reference even when it fails.
I suggest to extend this description another bit.
Which object is affected here?
> If this function returns an error, kobject_put() must be called to
> properly clean up the memory associated with the object.
Such a copy from the function description of this programming interface
can be helpful.
> Thus, when call of kobject_init_and_add() fail,
I propose to avoid the repetition of this condition.
> we should call kobject_put() instead of kfree().
How do you think about a wording variant like the following?
Replace a call of the function “kfree” by “kobject_put”
because of using kernel objects in the proper way.
> Previous commit "b8eb718348b8" fixed a similar problem.
I wonder if such information is really relevant for the commit message.
Regards,
Markus
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-29 5:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 5:45 [PATCH] PCI: Fix reference count leak in pci_create_slot() Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).