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 8823CA04A6; Mon, 24 Jan 2022 01:11:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 04F51428CA; Mon, 24 Jan 2022 01:06:44 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id B87544292E for ; Mon, 24 Jan 2022 01:06:39 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id o64so14665731pjo.2 for ; Sun, 23 Jan 2022 16:06:39 -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=5EQ9EclMKZF7bm0DCKVP8jt8Ph49KzbE4XPBP6y6DqU=; b=M7PmrkHnDgSAM2Qw3T75xRxeGp8uZJbs42qhM3TrszNQU3q1reWAFqi8KiiE/jHwh9 Tfba7X2rcx6fXheKuPZfrj98r1y0855pfAsFc+vxCP3dBXh/aUzL57JI8H5NLWfdossf P3pAiW0y0mFj4zLOwyt880d+dmSkvCErDyUp07Il1EVXG2GbmqSklAa0NNvjF3eNeZgt kwj7M0EqxiBXmHnU7GsI1/1vGnbZPMWmKEQagpPEmRXrXSHV2CcsQajnqEPVC7sla1Tp m6pz61TEYrV6K6wHKFGW+I6Og3Hc9qtCc4Z4TR3A58bHOxsUgWm2HVf8NCH3vX2T6aFH CUTQ== 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=5EQ9EclMKZF7bm0DCKVP8jt8Ph49KzbE4XPBP6y6DqU=; b=UHBWMmT0IEWicYUOn9+F2nxj9QtiIYGpEWkuYb9jo/FmtAJBByUElC8ggAXVc2+3fm Es6VjhDWV5GBsM3m8FxE78Df6eYhndEbTqfWoKNy/Vd0wOe+B5gzBWkGOj23TWGKZUCe 2asKoGV7np4dsMGMbK567NKbj8UslbzmEpI1f/spI2RKuXFNNlGAkRdD7ykjDl+9t/F/ ErpuEZGaOHy4VOTenufyaaskz1vTCu8lcYdhYAOTpyMfmYvvhaH4oTyFZ+xE9pXP+YeW bN7fJqlqAsClp9qE5zLuhlP4nufuF/h/RDZx44XF+ren7N9LDZ0eOkVNMPDJRbhT6Qbb CF1g== X-Gm-Message-State: AOAM531eMMiXxwdLwW7OgcXcNnYjfe8PLPjHW03kv+EW4HzchlZ0zqwo UFsr1ngvn4FzstwitM27Wvl99YmWkJEeHA== X-Google-Smtp-Source: ABdhPJwbg5HvLgBmV1uk2sE8EiiHemXpHyblwvwu+6unsEOYGbtQ2I4GzWrrxsXxOUId0Few+0vblQ== X-Received: by 2002:a17:902:8649:b0:149:f37a:9255 with SMTP id y9-20020a170902864900b00149f37a9255mr12513493plt.116.1642982798672; Sun, 23 Jan 2022 16:06:38 -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.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:38 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Xiao Wang Subject: [PATCH 74/82] vdpa/ifc: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:05:10 -0800 Message-Id: <20220124000518.319850-75-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/vdpa/ifc/ifcvf_vdpa.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 3853c4cf7e85..9f05595b6b34 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -226,8 +226,7 @@ ifcvf_dma_map(struct ifcvf_internal *internal, bool do_map) } exit: - if (mem) - free(mem); + free(mem); return ret; } @@ -253,8 +252,7 @@ hva_to_gpa(int vid, uint64_t hva) } exit: - if (mem) - free(mem); + free(mem); return gpa; } @@ -661,8 +659,7 @@ m_ifcvf_start(struct ifcvf_internal *internal) error: for (i = 0; i < nr_vring; i++) - if (internal->m_vring[i].desc) - rte_free(internal->m_vring[i].desc); + rte_free(internal->m_vring[i].desc); return -1; } -- 2.30.2