From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1C56A04A6; Mon, 24 Jan 2022 01:07:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07DF44282F; Mon, 24 Jan 2022 01:05:48 +0100 (CET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id A646242800 for ; Mon, 24 Jan 2022 01:05:44 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id t32so13625366pgm.7 for ; Sun, 23 Jan 2022 16:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DgkzBQTE1eMonz+N2UqWyLc7Hrzi1Ajc+itxrE9HTe0=; b=JGrvAxcLtSCyA1mI7JXRQTsJ1IrcKLgErQlGdUwfk2eveZWqimbJ1V8GSUVuZ72+Ei GaussXL6YkuyFrnbjhjnyQrFjr/7u7HG+nVaqPd4AvjRK2Fzg9OExICqj1y6yjtMim+Q c+k9pxO+Wi/mZy7LbvJ/+dyd6UDpAtBgH1Qi4biktY8TCWmEuL53d1LsiX2JP92x9U9I 4QF7vc5bJCF8+C9Z6/ruM+Wy7k/pL8EatJEk+a+SmfBNzVdEyv4cQH/syec9/qsVu806 Z2lEi8UekolWnzAOG7z09Jn9Uo1FaWAFLMCp834/vECk59kbumOzx4Kz20qZBXqYwy9T C6lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DgkzBQTE1eMonz+N2UqWyLc7Hrzi1Ajc+itxrE9HTe0=; b=xVl4sIKR3BpDHjDFqv/+000bMDolQAgwvTN3Z1ARpfBkmUCTxwr6UqBsB0yDk03CQT wAnX7qsVE3JFqDbmB01sSdEkBqd7kh7eWqo8UBxlPq3m2mVsG68cihmnf0cnQfuO4LcX Vwcm59KdshN36C2MZUdcyO08MvnzFucgJJUI6rPVetVY0lT+iY/903oZZy4Pozed0IUv QuUrMkgCfgVPegB6SPSBZFRuDri8jXXgrmo0I+oflydSjzavki7z+co0L8xmJEezThmn IFSKkqy237s/7cYwhs9EgEI3xSh1dVya09hnbykMrrpC7is1NlLvSXByp5IgfUJGvwWu ZVAg== X-Gm-Message-State: AOAM5334mgJQT/Ex7C/Z9RZYxeBMnrwTiTC4ExxI9DaO6sjwMaYT8Zs9 axB4EpKYBY57feoUe0g0t+MXycBaUDSELQ== X-Google-Smtp-Source: ABdhPJynqO+a1q7+d1DWzgBdN3edrDQy2fwQnSj+1b/PZJAZ4QQ9KnWJ2qEyVflvQETGgcTzxfqGGA== X-Received: by 2002:a05:6a00:1988:b0:4c3:b9cd:f09a with SMTP id d8-20020a056a00198800b004c3b9cdf09amr12177911pfl.2.1642982743629; Sun, 23 Jan 2022 16:05:43 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id ck21sm10935350pjb.51.2022.01.23.16.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:05:43 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 21/82] bus/pci: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:17 -0800 Message-Id: <20220124000518.319850-22-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124000518.319850-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Remove redundant NULL pointer checks before free functions found by nullfree.cocci Signed-off-by: Stephen Hemminger --- drivers/bus/pci/pci_params.c | 3 +-- drivers/bus/pci/windows/pci.c | 3 +-- drivers/bus/pci/windows/pci_netuio.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c index 60b424b8297e..61a868707f16 100644 --- a/drivers/bus/pci/pci_params.c +++ b/drivers/bus/pci/pci_params.c @@ -117,8 +117,7 @@ rte_pci_devargs_parse(struct rte_devargs *da) rte_pci_device_name(&addr, da->name, sizeof(da->name)); out: - if (kvargs != NULL) - rte_kvargs_free(kvargs); + rte_kvargs_free(kvargs); if (ret != 0) rte_errno = -ret; return ret; diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index 39ba31be7d38..7bf091158ba2 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -418,8 +418,7 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) return 0; end: - if (dev) - free(dev); + free(dev); return ret; } diff --git a/drivers/bus/pci/windows/pci_netuio.c b/drivers/bus/pci/windows/pci_netuio.c index a0b175a8fca0..5460399eea5f 100644 --- a/drivers/bus/pci/windows/pci_netuio.c +++ b/drivers/bus/pci/windows/pci_netuio.c @@ -180,8 +180,7 @@ get_netuio_device_info(HDEVINFO dev_info, PSP_DEVINFO_DATA dev_info_data, CloseHandle(netuio); } - if (dev_ifx_detail) - free(dev_ifx_detail); + free(dev_ifx_detail); if (di_set != INVALID_HANDLE_VALUE) SetupDiDestroyDeviceInfoList(di_set); -- 2.30.2