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 D816FA04AD; Mon, 24 Jan 2022 18:49:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E85542843; Mon, 24 Jan 2022 18:47:50 +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 63E104285C for ; Mon, 24 Jan 2022 18:47:47 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id z131so5002914pgz.12 for ; Mon, 24 Jan 2022 09:47:46 -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=hLCqG0/HZqdTtqepd4Hf62eb806TxOKaNSPswTVVlbnRMLgGEus7AhfnvcRdq1qaMC OL9MD6uqFKtdXS2+KVg0MYE8wlP7kQlONFqQTM3D1CccL1ji2GPUmHMkwOmYTAWoz25U i7p3HMMHRaT7zrcNlQ/NBg0Od2oTIBiFji/1D91/zxfKCL5IVOnr7T7ozBUfKiWOnJ3q YmTlL8so++1jW/ivYyyRIf5YWIIN+7Y5GXuIXO5w2L5iRjGM5m1DP0qEDSzWkAfXXjbc FIHs7MNR6BBwT4upfo1MeNcSEmU6mPRx90FzvX8xmr6vwo5IFVNWqx5DulllNAkU8cnF EQ9Q== 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=b9da+RqeP9NQ6truzhilbvnkb6Fjsu0tgwo2lLl0d4aVF0chz4urzkRjOyuevwENfa 8Xm3pAXBWVQ/Yf3pZsSBKcZzk1VKFv4u9aP32qvGwMxj2XkjyPKqGWKKUuAV+wElTICY RD68BX+95XhxydEPChSzZCd9/xkcyP030EHixfK1mmQXZFXXqal2Wg7enWW8oD80asJZ GwZpVIdRxAUmI4ATui6uz6BzUV2YNC8hZ25TsERFkyYCJN6to32BGAWQ25EMFhj0fj2K HJSSjub5zY+H3fst9r9I3r90DPnEranONepQ0ynq8AwuufIQ7X5JB6XjayEM6A4Is4vR enKw== X-Gm-Message-State: AOAM530o/frHzkZH8UI+tFoUN8o8urIJMBSJtQGvHSAuK9/ah+Fmr0Aq vng5MZ7FV3ZTrpyAJceJaUWVtpurfXQkSg== X-Google-Smtp-Source: ABdhPJwYdj03BhCWwkeYA1HRqWqbvEdZ9o9ku5R8n8Y6FTt/HTdeo6ST0fhY4webHpiVOd8Bm1/xVQ== X-Received: by 2002:a65:6ab3:: with SMTP id x19mr12533006pgu.416.1643046466019; Mon, 24 Jan 2022 09:47:46 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q7sm15835082pfs.37.2022.01.24.09.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:45 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 22/83] bus/pci: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:18 -0800 Message-Id: <20220124174719.14417-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124174719.14417-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124174719.14417-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