From d01e4132aec64c48b26817135a4caf8cb6a2aee8 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 23 Jan 2010 15:45:22 +0300 Subject: [PATCH 02/16] drbd: null dereference bug epoch is always NULL here. Signed-off-by: Dan Carpenter Signed-off-by: Philipp Reisner --- drbd/drbd_receiver.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c index 19d8e87..bb6903f 100644 --- a/drbd/drbd_receiver.c +++ b/drbd/drbd_receiver.c @@ -1271,7 +1271,7 @@ STATIC int receive_Barrier(struct drbd_conf *mdev, struct p_header *h) epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO); if (!epoch) { dev_warn(DEV, "Allocation of an epoch failed, slowing down\n"); - issue_flush = !test_and_set_bit(DE_BARRIER_IN_NEXT_EPOCH_ISSUED, &epoch->flags); + issue_flush = !test_and_set_bit(DE_BARRIER_IN_NEXT_EPOCH_ISSUED, &mdev->current_epoch->flags); drbd_wait_ee_list_empty(mdev, &mdev->active_ee); if (issue_flush) { rv = drbd_flush_after_epoch(mdev, mdev->current_epoch); -- 1.6.3.3