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 C69B6A04AD; Mon, 24 Jan 2022 18:54:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E30A42984; Mon, 24 Jan 2022 18:48:48 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 848104285D for ; Mon, 24 Jan 2022 18:48:44 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id x11so10536050plg.6 for ; Mon, 24 Jan 2022 09:48: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=5EQ9EclMKZF7bm0DCKVP8jt8Ph49KzbE4XPBP6y6DqU=; b=w3Qv0EMaZz9IfrQKqMZi4WjX8R22Z91Igg70/HPTeB73JZC1BxQ0Pl55p5kDVL4Ae6 SxI8EGXYw+uTWfWpsjnq3km1nO6i+FgfOKr+V8kBCthp6HuCmMQlhjnVAbffdVzpI/m/ f1jSA1/XgKSz9jphfcvFL70OEK92rlDfQy+rmO3ZYFPzn2+QKI9cvSrpEegJImk4J/mZ 404HMhOrakobwIirMp9/w6szabgmNi8bgAuh+eotcrIHs9lpAPIUxy0tCGGEaFjTH5sb FAsMEkeIvlqN1zenmqi8ftffNCislMTuLM67tPucwb+DjuJBkafwfmEXvU5DHH43PfJJ Q7qA== 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=u9F6Lv4tirpPgOW2GVMLxTOOgljLjzKJWm/+XMt68IqaTnQZLpzQZeDWkJwK9/wBRJ 7IlXFiVJbV0ZW5BCPPhzUvBombYZkSIJwNB83MmCGzrhww0qCJ2Pqb+kveJrm975+8kr TW966RfAeKywULrhZoK3Th+IqbulJM9Inp+tN/yGJ9fWTgvuAMyuOsKPMrxkI/6DJXc6 H6J+CMYqiEHCb3LEo7sYF5dtDRnTYxv/cdq0gp//lnzJCXqdKyyBfdjbp6YGv3rhcbUu t4CHyuSS5igg32GAdIDz/w8keR0+3BmvbfA827zWPPpaGYeFK4wKXnurmHzKkT4wgEYV rpUQ== X-Gm-Message-State: AOAM532KpG+I5qPLoqjSq5GQHZoZEK1ykQWO/dT1Gb4iYZb8poX7yChw uYryIZbylNm7AnnrDlZ8jbAJaal7S1D8iw== X-Google-Smtp-Source: ABdhPJwXLN0VQvjgH+plREr6RLX74zjfnuxwNyhqyk6ZrXkZnAogoM/VPC3HxSzO2a+Cp6tXa3iYVQ== X-Received: by 2002:a17:902:ab8f:b0:14a:adaa:93f2 with SMTP id f15-20020a170902ab8f00b0014aadaa93f2mr15015183plr.131.1643046523546; Mon, 24 Jan 2022 09:48: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.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:43 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Xiao Wang Subject: [PATCH v2 75/83] vdpa/ifc: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:47:11 -0800 Message-Id: <20220124174719.14417-76-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/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