Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb6e1921 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

net: hns: fix unsigned comparison to less than zero



commit ea401685a20b5d631957f024bda86e1f6118eb20 upstream.

Currently mskid is unsigned and hence comparisons with negative
error return values are always false. Fix this by making mskid an
int.

Fixes: f058e46855dc ("net: hns: fix ICMP6 neighbor solicitation messages discard problem")
Addresses-Coverity: ("Operands don't affect result")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5b049329
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2770,7 +2770,7 @@ static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port)
	struct hns_mac_cb *mac_cb;
	u8 addr[ETH_ALEN] = {0};
	u8 port_num;
	u16 mskid;
	int mskid;

	/* promisc use vague table match with vlanid = 0 & macaddr = 0 */
	hns_dsaf_set_mac_key(dsaf_dev, &mac_key, 0x00, port, addr);