[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100327145950.GG5069@bicker>
Date: Sat, 27 Mar 2010 17:59:50 +0300
From: Dan Carpenter <error27@...il.com>
To: Lars Ellenberg <drbd-dev@...ts.linbit.com>
Cc: Jens Axboe <jens.axboe@...cle.com>,
Philipp Reisner <philipp.reisner@...bit.com>,
drbd-user@...ts.linbit.com, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] drbd: potential null dereference
If "e" is NULL then "bm_ext" would be NULL too.
Signed-off-by: Dan Carpenter <error27@...il.com>
---
Found by static analysis and compile tested only. Sorry. :/
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index 17956ff..b68b778 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -1328,7 +1328,7 @@ int drbd_rs_del_all(struct drbd_conf *mdev)
for (i = 0; i < mdev->resync->nr_elements; i++) {
e = lc_element_by_index(mdev->resync, i);
bm_ext = e ? lc_entry(e, struct bm_extent, lce) : NULL;
- if (bm_ext->lce.lc_number == LC_FREE)
+ if (!bm_ext || bm_ext->lce.lc_number == LC_FREE)
continue;
if (bm_ext->lce.lc_number == mdev->resync_wenr) {
dev_info(DEV, "dropping %u in drbd_rs_del_all, apparently"
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists