git: 660b6999cc95 - stable/12 - ixgbe: fix impossible condition

Kevin Bowling kbowling at FreeBSD.org
Sun Oct 3 05:04:26 UTC 2021


The branch stable/12 has been updated by kbowling (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=660b6999cc95aa56f5981c538234bd3475b3abc5

commit 660b6999cc95aa56f5981c538234bd3475b3abc5
Author:     Eric van Gyzen <vangyzen at FreeBSD.org>
AuthorDate: 2020-08-21 19:34:41 +0000
Commit:     Kevin Bowling <kbowling at FreeBSD.org>
CommitDate: 2021-10-03 01:59:48 +0000

    ixgbe: fix impossible condition
    
    Coverity flagged this condition: The condition
        offset == 0 && offset == 65535
    can never be true because offset cannot be equal
    to two different values at the same time.
    
    Submitted by:   bret_ketchum at dell.com
    Reported by:    Coverity
    Reviewed by:    tsoome, cem
    MFC after:      2 weeks
    Sponsored by:   Dell EMC Isilon
    Differential Revision:  https://reviews.freebsd.org/D26144
    
    (cherry picked from commit ab1c54fec66803235a8923333fa79f2cbfa33354)
---
 sys/dev/ixgbe/ixgbe_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c
index d19f82bc3eab..50e18bcba997 100644
--- a/sys/dev/ixgbe/ixgbe_common.c
+++ b/sys/dev/ixgbe/ixgbe_common.c
@@ -5154,8 +5154,8 @@ void ixgbe_get_oem_prod_version(struct ixgbe_hw *hw,
 	nvm_ver->oem_valid = false;
 	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)
+	/* Return if offset to OEM Product Version block is invalid */
+	if (offset == 0x0 || offset == NVM_INVALID_PTR)
 		return;
 
 	/* Read product version block */


More information about the dev-commits-src-branches mailing list