From patchwork Mon Jan 24 17:46:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 106362 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 995F4A04AD; Mon, 24 Jan 2022 18:47:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97DCC427EE; Mon, 24 Jan 2022 18:47:29 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id F1A9140040 for ; Mon, 24 Jan 2022 18:47:26 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id v74so13426599pfc.1 for ; Mon, 24 Jan 2022 09:47:26 -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=YdXJ6SXhyaulL4IXSkRRXpWMolnffBjFZZPh6byh3mK9UCAbiHHXzFJZOiVsGtoLeR sRcYHccnQNSEGytuoBmu1bheZjDlObIoHMpj8E4gCpHx7MvWzv/fpcID9MeMi4k85EHn oRryCLmDcJYZcor11GNZ9/zBSl76YgXFdlEf1BkHp0SH8uPePgmHi15WW2O4Q9SlsFLu 9V6wxXq50bHqJE1Jpmf3CJOBfZ688Pa+DKZny7w110YDTijvBV+fFYHa3/mo0Kvx0G0H V29wo7oQZ/JtQWHcuiMfHN5pAZjgu4S/9Lw7xFJF5bYiD1geTIFUaxFVe76BxcSTMBbx tsRQ== 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=h5SKujUT/hZ568EX2Hqg7aiIUpYedUEsJxtTPJ5l1xcxrRavx0pghqIbikeiyymf8a DDJmYE/tkGNLpo34L4V/MPdnxjYU1v0bo39Qp7quVwbNig7vJmQ9nVwYZpu6SCtPIJKj aw19CazZDN6Nt0HRVHKIrbSs3cHKMYbf8vNuPpLrXG3uYbDwgihWrft1W9hWsszttEHm QHCexZpNo0Mh9Xp1zrsFF9Fdy9UShGMhU04Vt+SGEE9+EqtESnUezhBZXFFfZfEj0kxn ix1tMawnrp3TCl8TKsnRL5x8JcipGN2oayJ+oHBdvGIGpYK6zwPZTSsZeqBbbHmCluz9 oKww== X-Gm-Message-State: AOAM533NUV4J4Y/bKLPvgyELy6Gd1ZBWRWLH5qPnbpUwuNA+2wUy3NUh 9b35R81KXU98A1s2En4DxUKMPo0B/n0UjA== X-Google-Smtp-Source: ABdhPJyC9C3UeZpavt9vyQmDfebAkdyhbMMIsaMBqlSqlkVa+HpT5Y4jDwHJF4OQ9qDVAnuUSh5qyg== X-Received: by 2002:a63:2c81:: with SMTP id s123mr7619802pgs.241.1643046445918; Mon, 24 Jan 2022 09:47:25 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:25 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Subject: [PATCH v2 04/83] eal/windows: remove unnecessary NULL checks before free Date: Mon, 24 Jan 2022 09:46:00 -0800 Message-Id: <20220124174719.14417-5-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 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);