Skip to content

Commit f3b5384

Browse files
Andreas Gruenbachergregkh
authored andcommitted
direct-io: Prevent NULL pointer access in submit_page_section
commit 899f0429c7d3eed886406cd72182bee3b96aa1f9 upstream. In the code added to function submit_page_section by commit b1058b9, sdio->bio can currently be NULL when calling dio_bio_submit. This then leads to a NULL pointer access in dio_bio_submit, so check for a NULL bio in submit_page_section before trying to submit it instead. Fixes xfstest generic/250 on gfs2. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ac94abb commit f3b5384

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/direct-io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,8 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
823823
*/
824824
if (sdio->boundary) {
825825
ret = dio_send_cur_page(dio, sdio, map_bh);
826-
dio_bio_submit(dio, sdio);
826+
if (sdio->bio)
827+
dio_bio_submit(dio, sdio);
827828
page_cache_release(sdio->cur_page);
828829
sdio->cur_page = NULL;
829830
}

0 commit comments

Comments
 (0)