Skip to content

Commit 18a1cd9

Browse files
josephhzgregkh
authored andcommitted
ocfs2: correct return value of ocfs2_local_free_info()
[ Upstream commit d32840ad4a111c6abd651fbf6b5996e6123913da ] Now in ocfs2_local_free_info(), it returns 0 even if it actually fails. Though it doesn't cause any real problem since the only caller dquot_disable() ignores the return value, we'd better return correct as it is. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Joseph Qi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Stable-dep-of: 5f3fd772d152 ("ocfs2: fix slab-use-after-free due to dangling pointer dqi_priv") Signed-off-by: Sasha Levin <[email protected]>
1 parent ad9ec26 commit 18a1cd9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

fs/ocfs2/quota_local.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ static int ocfs2_local_free_info(struct super_block *sb, int type)
815815
struct ocfs2_quota_chunk *chunk;
816816
struct ocfs2_local_disk_chunk *dchunk;
817817
int mark_clean = 1, len;
818-
int status;
818+
int status = 0;
819819

820820
iput(oinfo->dqi_gqinode);
821821
ocfs2_simple_drop_lockres(OCFS2_SB(sb), &oinfo->dqi_gqlock);
@@ -857,17 +857,14 @@ static int ocfs2_local_free_info(struct super_block *sb, int type)
857857
oinfo->dqi_libh,
858858
olq_update_info,
859859
info);
860-
if (status < 0) {
860+
if (status < 0)
861861
mlog_errno(status);
862-
goto out;
863-
}
864-
865862
out:
866863
ocfs2_inode_unlock(sb_dqopt(sb)->files[type], 1);
867864
brelse(oinfo->dqi_libh);
868865
brelse(oinfo->dqi_lqi_bh);
869866
kfree(oinfo);
870-
return 0;
867+
return status;
871868
}
872869

873870
static void olq_set_dquot(struct buffer_head *bh, void *private)

0 commit comments

Comments
 (0)