summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2006-06-26 09:27:27 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 18:58:35 +0200
commit143535396c7ebd9395a931a000b3963f457712b8 (patch)
tree725203a6ed6be6c795fa0f0441aa1b91f5ea8721 /drivers/md/dm-table.c
parent[PATCH] dm: mirror sector offset fix (diff)
downloadlinux-143535396c7ebd9395a931a000b3963f457712b8.tar.xz
linux-143535396c7ebd9395a931a000b3963f457712b8.zip
[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>
Diffstat (limited to '')
-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)
struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index)
{
- if (index > t->num_targets)
+ if (index >= t->num_targets)
return NULL;
return t->targets + index;