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 9FF96A04AD; Mon, 24 Jan 2022 18:49:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86CD84285E; Mon, 24 Jan 2022 18:47:47 +0100 (CET) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id 9C6594284B for ; Mon, 24 Jan 2022 18:47:44 +0100 (CET) Received: by mail-pf1-f173.google.com with SMTP id 192so13239248pfz.3 for ; Mon, 24 Jan 2022 09:47: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=EQrCx0dno/N/ybIWGqGKAoHbfKSGtgncHhrQaZgaGS4=; b=yUE51ewoDk8DcKLtzVInSbci6oAEhteNR9oVWUPTNqWGmrjwcymB/e8vCOk92AQfw0 cJVEhFTv62EIU4KY4/r5gW77U9rdrsJwPBw6OeJl5XVdsqPcTauzEBX/gfp0+6awAvaO 65D/kpZWS7zeWvfbatxuMNRDI0uB4kcpT2PO2oArIl7nwrScubdjYhY0W8vdwMrUNvRk 4LR5ExK8VtR2BrmmuMBS/OW2ZcKQr7Rgs2/3OIVwtLNz2UC8D6S32nmkYQITJXOBkLQn VI2Qdqt0Mg0TwocV5UPYqG64wvpW+9EPCKluxwHv7iddFRwnFjTqCohSusn46V6SgkP8 zX4g== 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=EQrCx0dno/N/ybIWGqGKAoHbfKSGtgncHhrQaZgaGS4=; b=norpglST3TJE8EoTBm/U/P8QLC/8f7K4yUVY0ZZd5yYY7PEBBjMW36jr+H4f1xv6wP GUzvQrRuFhc6vOt0BsysnJKKpp+6xVi/Ntaq8jcOfZV8Aj1tgUcI+bFpSK9MZaJBa29I Tt51FLEuiH3E05+DVmc0bbPwf9aHton/al7cmIbn9KrpJMLcy9XpRUREyKR3eQrZtxwL jrseUX9PTSvLaSPwXbaIuRCVVZCBuXBr/2VazAJdCwhPldMYDuT78m3a8pvo5uw2voBP qfKW2PJbTFtt5dKwYewMO3rJmioXT3O6+hGB0j9y954pN6EslpfXMOg+B+LI4G9A/FRo Q/BQ== X-Gm-Message-State: AOAM530rwOiJ+9V556ejeI0eAcLN2hQaY06zqFTuT0ZtvxhXaKJ92Vm4 3ptX6waGHBZH4fH+x8x2NOuj69t915V+4Q== X-Google-Smtp-Source: ABdhPJyavRf3UCGR5/gOVaxBaGFrD7X4UOhENXN36g1odfr07nbamoKTAxOLwlwX6OwyU9A+qzCz9w== X-Received: by 2002:a63:7946:: with SMTP id u67mr12348100pgc.83.1643046463487; Mon, 24 Jan 2022 09:47:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:42 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH v2 20/83] bus/fslmc: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:16 -0800 Message-Id: <20220124174719.14417-21-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 Acked-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_bus.c | 6 ++---- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 53fd75539e98..30d019516b91 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -223,13 +223,11 @@ scan_one_fslmc_device(char *dev_name) insert_in_device_list(dev); /* Don't need the duplicated device filesystem entry anymore */ - if (dup_dev_name) - free(dup_dev_name); + free(dup_dev_name); return 0; cleanup: - if (dup_dev_name) - free(dup_dev_name); + free(dup_dev_name); if (dev) { rte_intr_instance_free(dev->intr_handle); free(dev); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 52605ea2c32c..943fadee4816 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -149,8 +149,7 @@ dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id, int cpu_id) if (!token) { DPAA2_BUS_WARN("Failed to get interrupt id for dpio.%d", dpio_id); - if (temp) - free(temp); + free(temp); fclose(file); return; } @@ -574,8 +573,7 @@ dpaa2_free_dq_storage(struct queue_storage_info_t *q_storage) int i = 0; for (i = 0; i < NUM_DQS_PER_QUEUE; i++) { - if (q_storage->dq_storage[i]) - rte_free(q_storage->dq_storage[i]); + rte_free(q_storage->dq_storage[i]); } } -- 2.30.2