Skip to content

Commit

Permalink
[ARM] Off-by-one in arch/arm/common/icst*
Browse files Browse the repository at this point in the history
hi,

a quick find -iname \*.[ch] | xargs grep "> ARRAY_SIZE(", revealed
these in the icst drivers.
If i == ARRAY_SIZE, we get past the idx2s array.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Eric Sesterhenn authored and Russell King committed Sep 27, 2006
1 parent 576b3ef commit d1d8f7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arch/arm/common/icst307.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq)
break;
} while (i < ARRAY_SIZE(idx2s));

if (i > ARRAY_SIZE(idx2s))
if (i >= ARRAY_SIZE(idx2s))
return vco;

vco.s = idx2s[i];
Expand Down Expand Up @@ -119,7 +119,7 @@ icst307_ps_to_vco(const struct icst307_params *p, unsigned long period)
break;
} while (i < ARRAY_SIZE(idx2s));

if (i > ARRAY_SIZE(idx2s))
if (i >= ARRAY_SIZE(idx2s))
return vco;

vco.s = idx2s[i];
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/common/icst525.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq)
break;
} while (i < ARRAY_SIZE(idx2s));

if (i > ARRAY_SIZE(idx2s))
if (i >= ARRAY_SIZE(idx2s))
return vco;

vco.s = idx2s[i];
Expand Down Expand Up @@ -118,7 +118,7 @@ icst525_ps_to_vco(const struct icst525_params *p, unsigned long period)
break;
} while (i < ARRAY_SIZE(idx2s));

if (i > ARRAY_SIZE(idx2s))
if (i >= ARRAY_SIZE(idx2s))
return vco;

vco.s = idx2s[i];
Expand Down

0 comments on commit d1d8f7d

Please sign in to comment.