diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-11-30 11:24:52 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-12-03 07:49:38 -0500 |
commit | f6f0f81895ad8272905bf3d637b7c99a62238d79 (patch) | |
tree | 147dab59d278dccaf45971060df5e7653a2bfb6f /drivers/mtd | |
parent | 5d3cce3b8ef45317c59487f4d83dc43c355ae40a (diff) |
[MTD] [NOR] Fix overflow check in jedec_probe
Having laid the code out so that it's easier to read instead of sticking
to the 80-column guideline even when it doesn't make sense, a bug is
immediately spotted... we were only checking _one_ of the unlock
addresses to see if it runs off the end of the map.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/chips/jedec_probe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c index cb8c34da360a..6041ce8908e3 100644 --- a/drivers/mtd/chips/jedec_probe.c +++ b/drivers/mtd/chips/jedec_probe.c | |||
@@ -1952,7 +1952,7 @@ static int jedec_probe_chip(struct map_info *map, __u32 base, | |||
1952 | } | 1952 | } |
1953 | /* Ensure the unlock addresses we try stay inside the map */ | 1953 | /* Ensure the unlock addresses we try stay inside the map */ |
1954 | probe_offset1 = cfi_build_cmd_addr(cfi->addr_unlock1, cfi_interleave(cfi), cfi->device_type); | 1954 | probe_offset1 = cfi_build_cmd_addr(cfi->addr_unlock1, cfi_interleave(cfi), cfi->device_type); |
1955 | probe_offset2 = cfi_build_cmd_addr(cfi->addr_unlock1, cfi_interleave(cfi), cfi->device_type); | 1955 | probe_offset2 = cfi_build_cmd_addr(cfi->addr_unlock2, cfi_interleave(cfi), cfi->device_type); |
1956 | if ( ((base + probe_offset1 + map_bankwidth(map)) >= map->size) || | 1956 | if ( ((base + probe_offset1 + map_bankwidth(map)) >= map->size) || |
1957 | ((base + probe_offset2 + map_bankwidth(map)) >= map->size)) | 1957 | ((base + probe_offset2 + map_bankwidth(map)) >= map->size)) |
1958 | goto retry; | 1958 | goto retry; |