summaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2024-09-26 11:05:29 +0200
committerRichard Weinberger <richard@nod.at>2024-11-14 18:48:20 +0100
commitc6fa76da34ae4f2eb95ce3fb6c939285082515de (patch)
tree15b22458c06d2c947836fb87749ab25c205308fd /fs/ubifs
parent5580cdae05aefa96deebd7f5ade9d70c92adabd7 (diff)
downloadlinux-stable-c6fa76da34ae4f2eb95ce3fb6c939285082515de.tar.gz
linux-stable-c6fa76da34ae4f2eb95ce3fb6c939285082515de.tar.bz2
linux-stable-c6fa76da34ae4f2eb95ce3fb6c939285082515de.zip
ubifs: Call iput(xino) only once in ubifs_purge_xattrs()
An iput(xino) call was immediately used after a return value check for a remove_xattr() call in this function implementation. Thus call such a function only once instead directly before the check. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/xattr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index c673fd03d9b4..cf77fb2074df 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -541,16 +541,14 @@ int ubifs_purge_xattrs(struct inode *host)
clear_nlink(xino);
err = remove_xattr(c, host, xino, &nm);
+ iput(xino);
if (err) {
kfree(pxent);
kfree(xent);
- iput(xino);
ubifs_err(c, "cannot remove xattr, error %d", err);
goto out_err;
}
- iput(xino);
-
kfree(pxent);
pxent = xent;
key_read(c, &xent->key, &key);