drbd: Null pointer deref fix to the large "multi bio rewrite"
authorPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 20 May 2010 11:35:31 +0000 (13:35 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 21 May 2010 19:12:01 +0000 (21:12 +0200)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/drbd/drbd_receiver.c

index 461d9872d4d395a92e4475fc76cdb16c058fb252..bc9ab7fb2cc7d6eaeda21fcfa07706cfe5a4c922 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)