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 1C06EA04A6; Mon, 24 Jan 2022 01:05:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B18A427C4; Mon, 24 Jan 2022 01:05:28 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 846CC427AB for ; Mon, 24 Jan 2022 01:05:25 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id d5so12234348pjk.5 for ; Sun, 23 Jan 2022 16:05:25 -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=OgIanIgFtHcdHoFnpNWsa8XIcvgA8wPsembFoHuQzfg=; b=qkrmeDnhk44ygwVEF1zMOau1P8ij0Mw/12WsagZrmkf5tlI/LDMODRk3Wh6jfg7SGH 6b8iEI7ElK4VnTMNQjmYERRA5z0F+i3XuAmRylbu8NZ0NE5i6bq+rfzprExh/wjDlMjg fIeCV5b2KPyCA6D5p6ij2c9DbWdwF8vw44s4WNz2U+JigG1+2gHyY60NnpIHXT/tva9O cHqAc7UdmFjQIgAzoiJ8rWnyESdIUbqMDQ33vh1zTi7MPqzCGyy4FGPUykg1+nqTMiOQ iswFFPMn1h7W8eGBWFsnZBvIiwZYmwbmsrMQlITLe5XIdUH9goJ78/oNejtTfQ4lC+Yw GMEg== 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=OgIanIgFtHcdHoFnpNWsa8XIcvgA8wPsembFoHuQzfg=; b=lJLocnTmW6iT3LPD+/v2d7xJ1zghWXbL9GtDWvIy/4KVNZFM9fvlDddVe7E6vyJkY0 ARephL4VMTcJWDbNhrhowEMX5hkog7XyX7VyhP8XcGSLXochTFzOMgnBOHqlrLYtRd9M QU5NjHB6SdTyZl7hpXjtQzDhHT13d1oar5ft3u1UvHPI2XCn07/lvN6WWPVXP+TowBM1 heVZoS8KKlysT7t7KssrR76CKoyXTNVWgTrB4ivA7dnsghthfoQL6IgWt4oYlgk9EDyl 2d2HksEDbaQhpbG2NCnIrqyPEtSVW4g5IqvoRHp1c7ygG6xJ6kwqfLSH8VJtZJHprpVT mZbQ== X-Gm-Message-State: AOAM53331BAXelxqgzwB43pVIeUt+5Cn8SSTo3ix8RrJOQqK7F2luAvR W3zEGEa7/cyLDnumAwcj1hxeBb6NxKYLiQ== X-Google-Smtp-Source: ABdhPJzv0A2WRnc2x1t6AGWOMrEY9TMqoYeA7Or4wzPQYqozc5P5EsL5vInvhGu2bIhkh1b4jpXDXA== X-Received: by 2002:a17:902:a5c6:b0:149:c926:7c31 with SMTP id t6-20020a170902a5c600b00149c9267c31mr12439719plq.141.1642982724528; Sun, 23 Jan 2022 16:05:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:05:24 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Subject: [PATCH 03/82] eal/windows: remove unnecessary NULL checks before free Date: Sun, 23 Jan 2022 16:03:59 -0800 Message-Id: <20220124000518.319850-4-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 Calling free/rte_free/rte_mempool_free,... with NULL pointer is allowed; so remove unnecessary NULL checks. Signed-off-by: Stephen Hemminger --- lib/eal/windows/eal_alarm.c | 3 +-- lib/eal/windows/eal_memory.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/eal/windows/eal_alarm.c b/lib/eal/windows/eal_alarm.c index 103c1f909da3..51fe752c16d4 100644 --- a/lib/eal/windows/eal_alarm.c +++ b/lib/eal/windows/eal_alarm.c @@ -162,8 +162,7 @@ rte_eal_alarm_set(uint64_t us, rte_eal_alarm_callback cb_fn, void *cb_arg) fail: if (timer != NULL) CloseHandle(timer); - if (ap != NULL) - free(ap); + free(ap); exit: rte_eal_trace_alarm_set(us, cb_fn, cb_arg, ret); diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 2fd37d97085e..215d768e2c57 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -190,8 +190,7 @@ eal_mem_virt2iova_init(void) ret = 0; exit: - if (detail != NULL) - free(detail); + free(detail); if (list != INVALID_HANDLE_VALUE) SetupDiDestroyDeviceInfoList(list); -- 2.30.2