From: Markus Elfring Date: Thu, 26 Sep 2024 09:05:29 +0000 (+0200) Subject: ubifs: Call iput(xino) only once in ubifs_purge_xattrs() X-Git-Tag: v6.13-rc1~19^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6fa76da34ae4f2eb95ce3fb6c939285082515de;p=thirdparty%2Fkernel%2Fstable.git 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 Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger --- diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index c673fd03d9b43..cf77fb2074dfc 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);