summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2024-09-26 11:28:48 +0200
committerRichard Weinberger <richard@nod.at>2024-11-14 18:49:24 +0100
commit79d3e562cb47864a10851328cbdfa0ee2177d9f6 (patch)
treef10525543bc2ff13ad999afa906c14880e6ec8c6
parentubifs: Call iput(xino) only once in ubifs_purge_xattrs() (diff)
downloadlinux-79d3e562cb47864a10851328cbdfa0ee2177d9f6.tar.xz
linux-79d3e562cb47864a10851328cbdfa0ee2177d9f6.zip
ubifs: Reduce kfree() calls in ubifs_purge_xattrs()
Move a pair of kfree() calls behind the label “out_err” so that two statements can be better reused at the end of this function implementation. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--fs/ubifs/xattr.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index cf77fb2074df..77ba172b6dea 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -532,8 +532,6 @@ int ubifs_purge_xattrs(struct inode *host)
ubifs_err(c, "dead directory entry '%s', error %d",
xent->name, err);
ubifs_ro_mode(c, err);
- kfree(pxent);
- kfree(xent);
goto out_err;
}
@@ -543,8 +541,6 @@ int ubifs_purge_xattrs(struct inode *host)
err = remove_xattr(c, host, xino, &nm);
iput(xino);
if (err) {
- kfree(pxent);
- kfree(xent);
ubifs_err(c, "cannot remove xattr, error %d", err);
goto out_err;
}
@@ -564,6 +560,8 @@ int ubifs_purge_xattrs(struct inode *host)
return 0;
out_err:
+ kfree(pxent);
+ kfree(xent);
up_write(&ubifs_inode(host)->xattr_sem);
return err;
}