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

2019-05-13 Thread Linus Torvalds
On Mon, May 13, 2019 at 3:37 PM Andreas Gruenbacher wrote: > > Sorry, I should have been more explicit. Would you mind taking this > patch, please? If it's more convenient or more appropriate, I'll send > a pull request instead. Done. However,I'd like to point out that when I see patches from

[PATCH] gfs2: Fix error path kobject memory leak

2019-05-13 Thread Andreas Gruenbacher
From: "Tobin C. Harding" If a call to kobject_init_and_add() fails we must call kobject_put() otherwise we leak memory. Function gfs2_sys_fs_add always calls kobject_init_and_add() which always calls kobject_init(). It is safe to leave object destruction up to the kobject release function and

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

2019-05-13 Thread Andreas Gruenbacher
On Mon, 13 May 2019 at 12:40, Tobin C. Harding wrote: > > On Mon, May 13, 2019 at 09:14:05AM +0200, Greg Kroah-Hartman wrote: > > On Mon, May 13, 2019 at 01:32:13PM +1000, Tobin C. Harding wrote: > > > If a call to kobject_init_and_add() fails we must call kobject_put() > > > otherwise we leak

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

2019-05-13 Thread Tobin C. Harding
On Mon, May 13, 2019 at 09:14:05AM +0200, Greg Kroah-Hartman wrote: > On Mon, May 13, 2019 at 01:32:13PM +1000, Tobin C. Harding wrote: > > If a call to kobject_init_and_add() fails we must call kobject_put() > > otherwise we leak memory. > > > > Function always calls kobject_init_and_add() which