diff options
author | Milan Broz <mbroz@redhat.com> | 2006-06-26 03:27:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:35 -0400 |
commit | 143535396c7ebd9395a931a000b3963f457712b8 (patch) | |
tree | 725203a6ed6be6c795fa0f0441aa1b91f5ea8721 | |
parent | e4c8b3ba34cc1aeab451c7a5cc843c5fd62cbe3d (diff) |
[PATCH] dm table: get_target: fix last index
The table is indexed from 0, so an index equal to t->num_targets should be
rejected.
(There is no code in the current tree that would exercise this bug.)
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/md/dm-table.c | 2 |
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 | ||
803 | struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index) | 803 | struct 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; |