From 23ce422748def9652fdc019f740cd7900fa2fe3b Mon Sep 17 00:00:00 2001 From: Philipp Reisner Date: Thu, 20 May 2010 13:35:31 +0200 Subject: drbd: Null pointer deref fix to the large "multi bio rewrite" Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe --- drivers/block/drbd/drbd_receiver.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 461d9872d4d3..bc9ab7fb2cc7 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -98,6 +98,10 @@ static struct page *page_chain_del(struct page **head, int n) BUG_ON(!head); page = *head; + + if (!page) + return NULL; + while (page) { tmp = page_chain_next(page); if (--n == 0) -- cgit v1.2.2