lkml.org 
[lkml]   [2020]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] PCI: Fix reference count leak in pci_create_slot()
From
Date
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

\
 
 \ /
  Last update: 2020-05-29 07:48    [W:0.030 / U:3.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site