]> git.baikalelectronics.ru Git - kernel.git/commit
mISDN: fix a loop count
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 15 Dec 2015 10:07:52 +0000 (13:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Dec 2015 17:42:27 +0000 (12:42 -0500)
commit8fa4ace275ab21bfcd295432649cf89e9344bf88
tree537f199c9badaf0e3d53601249e66bb6d877b8b8
parent7d7e25321ee8b3f9a6ca2e06ac05db7e59c28d81
mISDN: fix a loop count

There are two issue here.
1)  cnt starts as maxloop + 1 so all these loops iterate one more time
    than intended.
2)  At the end of the loop we test for "if (maxloop && !cnt)" but for
    the first two loops, we end with cnt equal to -1.  Changing this to
    a pre-op means we end with cnt set to 0.

Fixes: 4135c59e9731 ('mISDN: Add driver for Infineon ISDN chipset family')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/hardware/mISDN/mISDNipac.c