Skip to content

Commit c6d2547

Browse files
jankaragregkh
authored andcommitted
ext4: free orphan info with kvfree
commit 971843c511c3c2f6eda96c6b03442913bfee6148 upstream. Orphan info is now getting allocated with kvmalloc_array(). Free it with kvfree() instead of kfree() to avoid complaints from mm. Reported-by: Chris Mason <[email protected]> Fixes: 0a6ce20c1564 ("ext4: verify orphan file size is not too big") Cc: [email protected] Signed-off-by: Jan Kara <[email protected]> Message-ID: <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 45d88df commit c6d2547

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/ext4/orphan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ void ext4_release_orphan_info(struct super_block *sb)
513513
return;
514514
for (i = 0; i < oi->of_blocks; i++)
515515
brelse(oi->of_binfo[i].ob_bh);
516-
kfree(oi->of_binfo);
516+
kvfree(oi->of_binfo);
517517
}
518518

519519
static struct ext4_orphan_block_tail *ext4_orphan_block_tail(
@@ -637,7 +637,7 @@ int ext4_init_orphan_info(struct super_block *sb)
637637
out_free:
638638
for (i--; i >= 0; i--)
639639
brelse(oi->of_binfo[i].ob_bh);
640-
kfree(oi->of_binfo);
640+
kvfree(oi->of_binfo);
641641
out_put:
642642
iput(inode);
643643
return ret;

0 commit comments

Comments
 (0)