]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mISDN: fix a loop count
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 15 Dec 2015 10:07:52 +0000 (13:07 +0300)
committerWilly Tarreau <w@1wt.eu>
Fri, 29 Jan 2016 21:12:53 +0000 (22:12 +0100)
commit1fe6e68743f848b6bf49782508474b45544f8f40
treee922816962a50f4fd455531a978ba891acbc1d10
parent0dbf4344f37cd793e40f8e91ca19875cf849e7b0
mISDN: fix a loop count

commit 40d24c4d8a7430aa4dfd7a665fa3faf3b05b673f upstream.

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: cae86d4a4e56 ('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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 7eb2a0151e7c8a95d1be33a923718fb690452c61)
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/isdn/hardware/mISDN/mISDNipac.c