drbd: lc_element_by_index() never returns NULL
authorPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 2 Apr 2010 06:40:33 +0000 (08:40 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 2 Apr 2010 06:40:33 +0000 (08:40 +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_actlog.c

index 43e57f395fd601eff1c44b19021d4d58a93dbc83..df018990c42252f59f4e57c40abddabb3118368f 100644 (file)
@@ -1336,7 +1336,7 @@ int drbd_rs_del_all(struct drbd_conf *mdev)
                /* ok, ->resync is there. */
                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;
+                       bm_ext = lc_entry(e, struct bm_extent, lce);
                        if (bm_ext->lce.lc_number == LC_FREE)
                                continue;
                        if (bm_ext->lce.lc_number == mdev->resync_wenr) {