diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-22 13:25:37 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-22 13:25:37 -0800 |
commit | 9fe190462668d4dc6db56e819322624cbfda919b (patch) | |
tree | 2a9415b7b149cf7d65b36869a8489c0a6d66320f /fs/quota/quota_v2.c | |
parent | db990385427c278eef56aac2e2588ec8b8cab5b4 (diff) | |
parent | b9bffa10b267b045e2c106db75b311216d669529 (diff) |
Merge tag 'fs_for_v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull isofs, udf, and quota updates from Jan Kara:
"Several udf, isofs, and quota fixes"
* tag 'fs_for_v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
parser: Fix kernel-doc markups
udf: handle large user and group ID
isofs: handle large user and group ID
parser: add unsigned int parser
udf: fix silent AED tagLocation corruption
isofs: release buffer head before return
quota: Fix memory leak when handling corrupted quota file
Diffstat (limited to 'fs/quota/quota_v2.c')
-rw-r--r-- | fs/quota/quota_v2.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index c21106557a37..b1467f3921c2 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -164,19 +164,24 @@ static int v2_read_file_info(struct super_block *sb, int type) quota_error(sb, "Number of blocks too big for quota file size (%llu > %llu).", (loff_t)qinfo->dqi_blocks << qinfo->dqi_blocksize_bits, i_size_read(sb_dqopt(sb)->files[type])); - goto out; + goto out_free; } if (qinfo->dqi_free_blk >= qinfo->dqi_blocks) { quota_error(sb, "Free block number too big (%u >= %u).", qinfo->dqi_free_blk, qinfo->dqi_blocks); - goto out; + goto out_free; } if (qinfo->dqi_free_entry >= qinfo->dqi_blocks) { quota_error(sb, "Block with free entry too big (%u >= %u).", qinfo->dqi_free_entry, qinfo->dqi_blocks); - goto out; + goto out_free; } ret = 0; +out_free: + if (ret) { + kfree(info->dqi_priv); + info->dqi_priv = NULL; + } out: up_read(&dqopt->dqio_sem); return ret; |