]> git.baikalelectronics.ru Git - kernel.git/commit
staging: kpc2000: prevent underflow in cpld_reconfigure()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 24 Feb 2020 10:33:25 +0000 (13:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Mar 2020 06:52:31 +0000 (07:52 +0100)
commit39a8f99383ed8649e3da16de01d457d859f752b4
treeb8ccc0ccc2965a051dbe49c0d962da0d108dcd48
parent6aaa0fe0c629014262b61b0ce0567cc126edf8b4
staging: kpc2000: prevent underflow in cpld_reconfigure()

This function should not allow negative values of "wr_val".  If
negatives are allowed then capping the upper bound at 7 is
meaningless.  Let's make it unsigned.

Fixes: ed73d5d856bc ("staging: kpc2000: add initial set of Daktronics drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200224103325.hrxdnaeqsthplu42@kili.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc2000/core.c