Skip to content

Commit c6fa76d

Browse files
elfringrichardweinberger
authored andcommitted
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 <[email protected]> Reviewed-by: Zhihao Cheng <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 5580cda commit c6fa76d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/ubifs/xattr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,14 @@ int ubifs_purge_xattrs(struct inode *host)
541541

542542
clear_nlink(xino);
543543
err = remove_xattr(c, host, xino, &nm);
544+
iput(xino);
544545
if (err) {
545546
kfree(pxent);
546547
kfree(xent);
547-
iput(xino);
548548
ubifs_err(c, "cannot remove xattr, error %d", err);
549549
goto out_err;
550550
}
551551

552-
iput(xino);
553-
554552
kfree(pxent);
555553
pxent = xent;
556554
key_read(c, &xent->key, &key);

0 commit comments

Comments
 (0)