From: Neil Brown Date: Mon, 10 Dec 2007 23:49:30 +0000 (-0800) Subject: Fix NULL dereference in umem.c X-Git-Tag: firefly_0821_release~24058 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=794e64d5e9c7f088378e093a48eb36a30091d82d;p=firefly-linux-kernel-4.4.55.git Fix NULL dereference in umem.c Fix NULL dereference in umem.c Signed-off-by: Neil Brown Tested-by: Dave Chinner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 99806f9ee4ce..5f5095afb06b 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c @@ -484,7 +484,8 @@ static void process_page(unsigned long data) page->idx++; if (page->idx >= bio->bi_vcnt) { page->bio = bio->bi_next; - page->idx = page->bio->bi_idx; + if (page->bio) + page->idx = page->bio->bi_idx; } pci_unmap_page(card->dev, desc->data_dma_handle,