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 44CBBA04A6; Mon, 24 Jan 2022 01:11:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E97F24294C; Mon, 24 Jan 2022 01:06:44 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id D29704289F for ; Mon, 24 Jan 2022 01:06:40 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id u10so9694917pfg.10 for ; Sun, 23 Jan 2022 16:06:40 -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=GRDAuxuSBVGu0f5cksd8Yr7OU7H6KcL7WM0YksWYbK0=; b=6uzNHq9fVRQ0e3duWn711jKJV14QHyZmjgKL2zvQlh6pyOtl/W5Q7XLPDxhYK0F//1 UaU3RItJLkEWNdJKcMG1l7Jgva2IH7e86v6zuJR8YJ3iINkt3VQjsLMoWXtQQJMz6cXC Dj+lC74/kp8bgdta8kuSd2odz3oi9Vr8tdfOajr/JP+fg7KAwIbFMIKhzuJfkrEuHzjK nGCDJ6dyxv9+OtObW56HXDBAA7SzXSXq5SHxta2XZ6dtwWJIrgjC0Jy/bbiG2p9zOHlm BGYoYAVWLBKa0KwIsam4DsrbMAxHL93CjTOvxNq5Z4WeSYOQlS30ZbzCn3pwC2jgOZAU eUVg== 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=GRDAuxuSBVGu0f5cksd8Yr7OU7H6KcL7WM0YksWYbK0=; b=IUhLzqclug/KNT5kVt6Sroejc+XqklcT5rPsp2MN9VAcg1ulXqaXx7fU+JzLFN0uGs JqrLHgOlwEDnbxKBgdAopECP/1GHq3XvWc798CX1ZZ576xH7LMfHCanSVP/eVocifP/Z NS3Sa7jIgkgtBhSPAg8h7a2Bcu8z8UlQ+sS87i2emjTgX5Tcy4DXf0qQ9Gtl8R3O4DDD wLyX/wDiaUauLnEkOym1ab4jQ5srUmaHdMyNeuElL1pWaAGajWjp+6YfBKJ6XMQOcvAV g6j3lCG3yFLSE8KMnX/uBz5iOa8nl5dXvS+ijFwZNdfiOjV8B4bshd85OjnMox7EBsHd OpqA== X-Gm-Message-State: AOAM531mDm00/LtvMVrWiKfmRAeZ+8F2x+OXBE/m6XhHp4T/J0VzQ5bV Touwj4v5e3BtAoRhPzIw6IrobjgmPJq8/Q== X-Google-Smtp-Source: ABdhPJyLB0y5FuPFihDDGCROwJPa4o73BKFexsaSBI82O8SHo3uoKOYWjr7uijDuS8D8q0nIfFTqBQ== X-Received: by 2002:aa7:928e:0:b0:4ba:fa67:d87 with SMTP id j14-20020aa7928e000000b004bafa670d87mr11826208pfa.41.1642982799799; Sun, 23 Jan 2022 16:06:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:39 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH 75/82] vdpa/mlx5: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:05:11 -0800 Message-Id: <20220124000518.319850-76-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/mlx5/mlx5_vdpa_mem.c | 3 +-- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_mem.c b/drivers/vdpa/mlx5/mlx5_vdpa_mem.c index 130d201a85f5..599079500b03 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_mem.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_mem.c @@ -283,8 +283,7 @@ mlx5_vdpa_mem_register(struct mlx5_vdpa_priv *priv) priv->gpa_mkey_index = entry->mkey->id; return 0; error: - if (entry) - rte_free(entry); + rte_free(entry); mlx5_vdpa_mem_dereg(priv); rte_errno = -ret; return ret; diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c index 2f32aef67fbc..3416797d289c 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c @@ -91,8 +91,7 @@ mlx5_vdpa_virtq_unset(struct mlx5_vdpa_virtq *virtq) if (virtq->umems[i].obj) claim_zero(mlx5_glue->devx_umem_dereg (virtq->umems[i].obj)); - if (virtq->umems[i].buf) - rte_free(virtq->umems[i].buf); + rte_free(virtq->umems[i].buf); } memset(&virtq->umems, 0, sizeof(virtq->umems)); if (virtq->eqp.fw_qp) -- 2.30.2