From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F181FC433FF for ; Thu, 8 Aug 2019 01:16:41 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 5C5D02184E for ; Thu, 8 Aug 2019 01:16:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C5D02184E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 667C7F94; Thu, 8 Aug 2019 03:16:40 +0200 (CEST) Received: from mxct.zte.com.cn (mx7.zte.com.cn [202.103.147.169]) by dpdk.org (Postfix) with ESMTP id C7D851D7; Thu, 8 Aug 2019 03:16:38 +0200 (CEST) Received: from mse-fl1.zte.com.cn (unknown [10.30.14.238]) by Forcepoint Email with ESMTPS id 7BC395509D2AE493B6CC; Thu, 8 Aug 2019 09:16:37 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse-fl1.zte.com.cn with ESMTP id x781G0QW006802; Thu, 8 Aug 2019 09:16:00 +0800 (GMT-8) (envelope-from zhang.congwen@zte.com.cn) Received: from 99-99-1-100.lightspeed.wepbfl.sbcglobal.net ([10.43.166.165]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019080809162668-2808272 ; Thu, 8 Aug 2019 09:16:26 +0800 From: Congwen Zhang To: wenzhuo.lu@intel.com Cc: dev@dpdk.org, stable@dpdk.org, Congwen Zhang Date: Thu, 8 Aug 2019 08:37:20 +0800 Message-Id: <1565224640-24239-1-git-send-email-zhang.congwen@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-08-08 09:16:26, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-08-08 09:16:05, Serialize complete at 2019-08-08 09:16:05 X-MAIL: mse-fl1.zte.com.cn x781G0QW006802 Subject: [dpdk-dev] [PATCH v3] net/ixgbe: fix offset value check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The "and" condition offset == 0 && offset == NVM_INVALID_PTR can never be true. Fixes: cf3af5aa56c9 ("net/ixgbe/base: add functions to get version info") Cc: stable@dpdk.org Signed-off-by: Congwen Zhang Acked-by: Xiaolong Ye --- drivers/net/ixgbe/base/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/base/ixgbe_common.c b/drivers/net/ixgbe/base/ixgbe_common.c index fb50719..62ff767 100644 --- a/drivers/net/ixgbe/base/ixgbe_common.c +++ b/drivers/net/ixgbe/base/ixgbe_common.c @@ -5040,7 +5040,7 @@ void ixgbe_get_oem_prod_version(struct ixgbe_hw *hw, hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset); /* Return is offset to OEM Product Version block is invalid */ - if (offset == 0x0 && offset == NVM_INVALID_PTR) + if (offset == 0x0 || offset == NVM_INVALID_PTR) return; /* Read product version block */ -- 1.8.3.1