From: Philipp Reisner Date: Thu, 20 May 2010 11:35:31 +0000 (+0200) Subject: drbd: Null pointer deref fix to the large "multi bio rewrite" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=23ce422748def9652fdc019f740cd7900fa2fe3b;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 --- 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)