Skip to content

Commit

Permalink
IRDA: cnt is off by 1
Browse files Browse the repository at this point in the history
If no prior break occurs, cnt reaches 101 after the loop, so we are still able
to change speed when cnt has become 100.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roel Kluin authored and David S. Miller committed Feb 13, 2009
1 parent acdb602 commit fb08867
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/irda/mcs7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
mcs_get_reg(mcs, MCS_RESV_REG, &rval);
} while(cnt++ < 100 && (rval & MCS_IRINTX));

if(cnt >= 100) {
if (cnt > 100) {
IRDA_ERROR("unable to change speed\n");
ret = -EIO;
goto error;
Expand Down

0 comments on commit fb08867

Please sign in to comment.