Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

isofs: release buffer head before return

Release the buffer_head before returning error code in
do_isofs_readdir() and isofs_find_entry().

Fixes: 2deb1acc653c ("isofs: fix access to unallocated memory when reading corrupted filesystem")
Link: https://lore.kernel.org/r/20210118120455.118955-1-bianpan2016@163.com
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Pan Bian and committed by
Jan Kara
0a6dc67a a4db1072

+2
+1
fs/isofs/dir.c
··· 152 152 printk(KERN_NOTICE "iso9660: Corrupted directory entry" 153 153 " in block %lu of inode %lu\n", block, 154 154 inode->i_ino); 155 + brelse(bh); 155 156 return -EIO; 156 157 } 157 158
+1
fs/isofs/namei.c
··· 102 102 printk(KERN_NOTICE "iso9660: Corrupted directory entry" 103 103 " in block %lu of inode %lu\n", block, 104 104 dir->i_ino); 105 + brelse(bh); 105 106 return 0; 106 107 } 107 108