]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvpp2: cls: fix less than zero check on a u32 variable
authorColin Ian King <colin.king@canonical.com>
Sun, 5 May 2019 21:38:14 +0000 (22:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 19:14:29 +0000 (12:14 -0700)
commit2f54f36312a65794daadc191c3087e9d9c12e443
tree1ed2b70af929791a4cb720300a82879cc3365f77
parentdb95c6691bbda1fd87ad057613af36736b0f71ea
net: mvpp2: cls: fix less than zero check on a u32 variable

The signed return from the call to mvpp2_cls_c2_port_flow_index is being
assigned to the u32 variable c2.index and then checked for a negative
error condition which is always going to be false. Fix this by assigning
the return to the int variable index and checking this instead.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 972cece191b5 ("net: mvpp2: cls: Add Classification offload support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c