drbd: Null pointer deref fix to the large "multi bio rewrite"
[safe/jmp/linux-2.6] / drivers / block / drbd / drbd_receiver.c
index 461d987..bc9ab7f 100644 (file)
@@ -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)