This issue was reported by PVS studio, described as:
https://pvs-studio.com/en/docs/warnings/v526/

Signed-off-by: Renyong Wan <wa...@yunsilicon.com>
---
 drivers/net/xsc/xsc_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/xsc/xsc_ethdev.c b/drivers/net/xsc/xsc_ethdev.c
index 44d861e484..28af9c5d15 100644
--- a/drivers/net/xsc/xsc_ethdev.c
+++ b/drivers/net/xsc/xsc_ethdev.c
@@ -663,7 +663,7 @@ xsc_ethdev_mac_addr_add(struct rte_eth_dev *dev, struct 
rte_ether_addr *mac, uin
        for (i = 0; i != XSC_MAX_MAC_ADDRESSES; ++i) {
                if (i == (int)index)
                        continue;
-               if (memcmp(&dev->data->mac_addrs[i], mac, sizeof(*mac)))
+               if (memcmp(&dev->data->mac_addrs[i], mac, sizeof(*mac)) != 0)
                        continue;
                /* Address already configured elsewhere, return with error */
                rte_errno = EADDRINUSE;
-- 
2.25.1

Reply via email to