From 794e64d5e9c7f088378e093a48eb36a30091d82d Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 10 Dec 2007 15:49:30 -0800 Subject: [PATCH] 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 --- drivers/block/umem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 99806f9ee4c..5f5095afb06 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, -- 2.41.1