From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id D8CDB5A6B for ; Fri, 6 Nov 2015 17:40:55 +0100 (CET) Received: by wmll128 with SMTP id l128so45625855wml.0 for ; Fri, 06 Nov 2015 08:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=mUP+M/bhHv+sY37obbOKGqtKJqme1W5XWpc8CnpjYYo=; b=gQ51+gxwVpviimXM1rLMjbnu8C+0cDkg9oUOO4pj6X3xMVmY/s3/57o1R4eY7X2BF4 HjJWJmDVewtwUp4Lah0WSEI57Gnd7mJ6rnxB5LDqoIVKZStbfsGQYxtOZTS+lOKXnYsZ p/NFzEKc7EgGFxRVfvpSCtyPonE1bjIIMLfD5CP2bDCAwvyJMUVIgZbtBOFEObkK2QzT 4/EwZ+zRohEmrCZM7BmjRmFQhsN/BgRU9qf6JAMLquqt2r6oe5pJ6RA/vxrBWM1WpDbl 73HRzhFT4x6Ey5OougjclpXg+M/ym2CFKp/UWIGPbD+ZTG/ZPANiJ16Fddh5JrtzjwVz TCjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=mUP+M/bhHv+sY37obbOKGqtKJqme1W5XWpc8CnpjYYo=; b=BlcztcERdFjypCKa970DDp8L/grgXK3IYa8p6yPFgFYEqKrKcuXU1SV9Qpb7DnE46g M1W2VEuchGAXP63ghNjtVbVkynQ+GWGcdRnRZ/hz/jDKU7lXhTyhQyG8ADd+tQhimTtv 65IX+tiVQ4UNBFBIxTaTsvmQEkfyeH/PZ4AMZUEzMFOavRIUqe5U5t0iReOgoUovTJLo Ak3EBx3VdgnGESIFulCos0dJamt+zTlJMg46CoBgBS4qOx+Owtw+iPWshKe+lz4UPyS5 Wghh6gBsBYN7rmnjaY3hd1OU81phV87fqCSY9lQeDckKLEzbv+yfMPzjhnvzks3vWPwa gCDw== X-Gm-Message-State: ALoCoQmTeaTOe5hU/4F4GxX/NFcWCqEKFViz7By11VTJCxG/xzaYCI8LkIGPMevDCxuUHA5vDcXh X-Received: by 10.28.18.11 with SMTP id 11mr11046214wms.68.1446828055774; Fri, 06 Nov 2015 08:40:55 -0800 (PST) Received: from xps13.localnet ([2a01:e34:ed05:e030:7e7a:91ff:fe14:f0d2]) by smtp.gmail.com with ESMTPSA id jh4sm899718wjb.33.2015.11.06.08.40.55 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 Nov 2015 08:40:55 -0800 (PST) From: Thomas Monjalon To: Bernard Iremonger Date: Fri, 06 Nov 2015 17:39:43 +0100 Message-ID: <15745635.HYcjktu7yu@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1446827408-32393-1-git-send-email-bernard.iremonger@intel.com> References: <1446827408-32393-1-git-send-email-bernard.iremonger@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 1/1] librte_ether: fix coverity errors in rte_eth_copy_pci_info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2015 16:40:56 -0000 2015-11-06 16:30, Bernard Iremonger: > add else branch to if statement. I think a return statement would be more appropriate. > Dereferencing NULL pointer reported by Coverity, CID 119256. > Dereferencing NULL pointer reported by Coverity, CID 119257. > > Signed-off-by: Bernard Iremonger [...] > if ((eth_dev == NULL) || (pci_dev == NULL)) { > PMD_DEBUG_TRACE("NULL pointer eth_dev=%p pci_dev=%p\n", > eth_dev, pci_dev); > - } > - > - eth_dev->data->dev_flags = 0; > - if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) > - eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; > - if (pci_dev->driver->drv_flags & RTE_PCI_DRV_DETACHABLE) > - eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE; > + } else { > + eth_dev->data->dev_flags = 0; > + if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) > + eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC; > + if (pci_dev->driver->drv_flags & RTE_PCI_DRV_DETACHABLE) > + eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;