Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IRDA: cnt is off by 1

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>

authored by

Roel Kluin and committed by
David S. Miller
fb088674 acdb602f

+1 -1
+1 -1
drivers/net/irda/mcs7780.c
··· 585 585 mcs_get_reg(mcs, MCS_RESV_REG, &rval); 586 586 } while(cnt++ < 100 && (rval & MCS_IRINTX)); 587 587 588 - if(cnt >= 100) { 588 + if (cnt > 100) { 589 589 IRDA_ERROR("unable to change speed\n"); 590 590 ret = -EIO; 591 591 goto error;