summaryrefslogtreecommitdiff
path: root/fs/gfs2/sys.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2019-05-17 00:46:30 +0300
committerAndreas Gruenbacher <agruenba@redhat.com>2019-06-27 21:53:45 +0300
commit2a27b755ed244527df845f07f4dd83988a90f2e4 (patch)
tree514a0b34f5509029336314c82f6be5ad07f7ee35 /fs/gfs2/sys.c
parent4b972a01a7da614b4796475f933094751a295a2f (diff)
downloadlinux-2a27b755ed244527df845f07f4dd83988a90f2e4.tar.xz
gfs2: Clean up freeing struct gfs2_sbd
Add a free_sbd function for freeing a struct gfs2_sbd. Use that for freeing a super-block descriptor, either directly or via kobject_put. Free sd_lkstats inside the kobject release function: that way, gfs2_put_super will no longer leak sd_lkstats. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/sys.c')
-rw-r--r--fs/gfs2/sys.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 159aedf63c2a..325612ce1c6b 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -301,7 +301,7 @@ static void gfs2_sbd_release(struct kobject *kobj)
{
struct gfs2_sbd *sdp = container_of(kobj, struct gfs2_sbd, sd_kobj);
- kfree(sdp);
+ free_sbd(sdp);
}
static struct kobj_type gfs2_ktype = {
@@ -679,7 +679,6 @@ fail_lock_module:
fail_tune:
sysfs_remove_group(&sdp->sd_kobj, &tune_group);
fail_reg:
- free_percpu(sdp->sd_lkstats);
fs_err(sdp, "error %d adding sysfs files\n", error);
kobject_put(&sdp->sd_kobj);
sb->s_fs_info = NULL;