diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-01-13 00:28:34 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-16 08:37:07 -0500 |
commit | 82033bc52abeb266cb3403e783a276d4a3d6cf9f (patch) | |
tree | 56b93ce0cca835d99cacaf8ba998a1f3cb8c36f1 /drivers | |
parent | c24e13713762a30f22468ac2c3d053abacb7672d (diff) |
[media] mb86a20s: fix off by one checks
Clearly ">=" was intended here instead of ">".
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/mb86a20s.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/mb86a20s.c b/drivers/media/dvb/frontends/mb86a20s.c index 7fa3e472cdca..fade566927c3 100644 --- a/drivers/media/dvb/frontends/mb86a20s.c +++ b/drivers/media/dvb/frontends/mb86a20s.c | |||
@@ -402,7 +402,7 @@ static int mb86a20s_get_modulation(struct mb86a20s_state *state, | |||
402 | [2] = 0x8e, /* Layer C */ | 402 | [2] = 0x8e, /* Layer C */ |
403 | }; | 403 | }; |
404 | 404 | ||
405 | if (layer > ARRAY_SIZE(reg)) | 405 | if (layer >= ARRAY_SIZE(reg)) |
406 | return -EINVAL; | 406 | return -EINVAL; |
407 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); | 407 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); |
408 | if (rc < 0) | 408 | if (rc < 0) |
@@ -435,7 +435,7 @@ static int mb86a20s_get_fec(struct mb86a20s_state *state, | |||
435 | [2] = 0x8f, /* Layer C */ | 435 | [2] = 0x8f, /* Layer C */ |
436 | }; | 436 | }; |
437 | 437 | ||
438 | if (layer > ARRAY_SIZE(reg)) | 438 | if (layer >= ARRAY_SIZE(reg)) |
439 | return -EINVAL; | 439 | return -EINVAL; |
440 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); | 440 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); |
441 | if (rc < 0) | 441 | if (rc < 0) |
@@ -470,7 +470,7 @@ static int mb86a20s_get_interleaving(struct mb86a20s_state *state, | |||
470 | [2] = 0x90, /* Layer C */ | 470 | [2] = 0x90, /* Layer C */ |
471 | }; | 471 | }; |
472 | 472 | ||
473 | if (layer > ARRAY_SIZE(reg)) | 473 | if (layer >= ARRAY_SIZE(reg)) |
474 | return -EINVAL; | 474 | return -EINVAL; |
475 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); | 475 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); |
476 | if (rc < 0) | 476 | if (rc < 0) |
@@ -494,7 +494,7 @@ static int mb86a20s_get_segment_count(struct mb86a20s_state *state, | |||
494 | [2] = 0x91, /* Layer C */ | 494 | [2] = 0x91, /* Layer C */ |
495 | }; | 495 | }; |
496 | 496 | ||
497 | if (layer > ARRAY_SIZE(reg)) | 497 | if (layer >= ARRAY_SIZE(reg)) |
498 | return -EINVAL; | 498 | return -EINVAL; |
499 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); | 499 | rc = mb86a20s_writereg(state, 0x6d, reg[layer]); |
500 | if (rc < 0) | 500 | if (rc < 0) |