isofs: release buffer head before return

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

Fixes: 2deb1acc65 ("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>
This commit is contained in:
Pan Bian 2021-01-18 04:04:55 -08:00 коммит произвёл Jan Kara
Родитель a4db1072e1
Коммит 0a6dc67a6a
2 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -152,6 +152,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file,
printk(KERN_NOTICE "iso9660: Corrupted directory entry" printk(KERN_NOTICE "iso9660: Corrupted directory entry"
" in block %lu of inode %lu\n", block, " in block %lu of inode %lu\n", block,
inode->i_ino); inode->i_ino);
brelse(bh);
return -EIO; return -EIO;
} }

Просмотреть файл

@ -102,6 +102,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
printk(KERN_NOTICE "iso9660: Corrupted directory entry" printk(KERN_NOTICE "iso9660: Corrupted directory entry"
" in block %lu of inode %lu\n", block, " in block %lu of inode %lu\n", block,
dir->i_ino); dir->i_ino);
brelse(bh);
return 0; return 0;
} }