aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-table.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 8f56a54cf0ce..b6183eda8106 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -802,7 +802,7 @@ sector_t dm_table_get_size(struct dm_table *t)
802 802
803struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index) 803struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index)
804{ 804{
805 if (index > t->num_targets) 805 if (index >= t->num_targets)
806 return NULL; 806 return NULL;
807 807
808 return t->targets + index; 808 return t->targets + index;