diff options
| author | Tobin C. Harding <[email protected]> | 2019-05-13 03:39:11 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2019-05-16 12:31:01 +0000 |
| commit | 450ff8348808a89cc27436771aa05c2b90c0eef1 (patch) | |
| tree | f3b1626d7b2620b987f9d0f2f06783fdf228466b /lib/test_stackinit.c | |
| parent | Btrfs: do not abort transaction at btrfs_update_root() after failure to COW path (diff) | |
| download | kernel-450ff8348808a89cc27436771aa05c2b90c0eef1.tar.gz kernel-450ff8348808a89cc27436771aa05c2b90c0eef1.zip | |
btrfs: sysfs: Fix error path kobject memory leak
If a call to kobject_init_and_add() fails we must call kobject_put()
otherwise we leak memory.
Calling kobject_put() when kobject_init_and_add() fails drops the
refcount back to 0 and calls the ktype release method (which in turn
calls the percpu destroy and kfree).
Add call to kobject_put() in the error path of call to
kobject_init_and_add().
Cc: [email protected] # v4.4+
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Tobin C. Harding <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/test_stackinit.c')
0 files changed, 0 insertions, 0 deletions
