Re: [PATCH] ocfs2: Fix error path kobject memory leak

2019-05-13 Thread Joseph Qi
On 19/5/13 11:34, Tobin C. Harding wrote: > If a call to kobject_init_and_add() fails we should call kobject_put() > otherwise we leak memory. > > Add call to kobject_put() in the error path of call to > kobject_init_and_add(). Please note, this has the side effect that > the release method is

Re: [PATCH] ocfs2: Fix error path kobject memory leak

2019-05-13 Thread Greg Kroah-Hartman
On Mon, May 13, 2019 at 01:34:58PM +1000, Tobin C. Harding wrote: > If a call to kobject_init_and_add() fails we should call kobject_put() > otherwise we leak memory. > > Add call to kobject_put() in the error path of call to > kobject_init_and_add(). Please note, this has the side effect that >

[PATCH] ocfs2: Fix error path kobject memory leak

2019-05-12 Thread Tobin C. Harding
If a call to kobject_init_and_add() fails we should call kobject_put() otherwise we leak memory. Add call to kobject_put() in the error path of call to kobject_init_and_add(). Please note, this has the side effect that the release method is called if kobject_init_and_add() fails. Signed-off-by: