Skip to content

Commit 79d3e56

Browse files
elfringrichardweinberger
authored andcommitted
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>
1 parent c6fa76d commit 79d3e56

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

fs/ubifs/xattr.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,6 @@ int ubifs_purge_xattrs(struct inode *host)
532532
ubifs_err(c, "dead directory entry '%s', error %d",
533533
xent->name, err);
534534
ubifs_ro_mode(c, err);
535-
kfree(pxent);
536-
kfree(xent);
537535
goto out_err;
538536
}
539537

@@ -543,8 +541,6 @@ int ubifs_purge_xattrs(struct inode *host)
543541
err = remove_xattr(c, host, xino, &nm);
544542
iput(xino);
545543
if (err) {
546-
kfree(pxent);
547-
kfree(xent);
548544
ubifs_err(c, "cannot remove xattr, error %d", err);
549545
goto out_err;
550546
}
@@ -564,6 +560,8 @@ int ubifs_purge_xattrs(struct inode *host)
564560
return 0;
565561

566562
out_err:
563+
kfree(pxent);
564+
kfree(xent);
567565
up_write(&ubifs_inode(host)->xattr_sem);
568566
return err;
569567
}

0 commit comments

Comments
 (0)