]> git.baikalelectronics.ru Git - kernel.git/commit
net: pcs: xpcs: Fix a less than zero u16 comparison error
authorColin Ian King <colin.king@canonical.com>
Tue, 15 Jun 2021 13:52:53 +0000 (14:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jun 2021 18:14:06 +0000 (11:14 -0700)
commit905b77f12f15530493ac4c1fcb8a6bf296b4478f
tree0c7c7e8ade5e04fb7eacd76ecb3ddf86c5fc6e2e
parenteea74010849fe3c362be1bec6ff768070253100e
net: pcs: xpcs: Fix a less than zero u16 comparison error

Currently the check for the u16 variable val being less than zero is
always false because val is unsigned. Fix this by using the int
variable for the assignment and less than zero check.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: e0c65b41ed9d ("net: pcs: xpcs: add support for NXP SJA1110")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcs/pcs-xpcs-nxp.c