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 D3649A04AD; Mon, 24 Jan 2022 18:54:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2ED9B429BA; Mon, 24 Jan 2022 18:48:49 +0100 (CET) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id A8F15429A8 for ; Mon, 24 Jan 2022 18:48:45 +0100 (CET) Received: by mail-pg1-f173.google.com with SMTP id z131so5005382pgz.12 for ; Mon, 24 Jan 2022 09:48:45 -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=nZKo+7rwiu7g9lcXAmSb4yEC2D+rOInbcVI120R//0vjBKclX9d9HExlMY3sIaqBge gW/A0RX+acE6SzL+mbUDCzcb0Gw8KTvg9dzb0Ma2VgD3wCKUYPMQHT7uFnoOHuecbprf mD6ELXVhHlqP7Khixm/ppA0LtTyqatJX3Z+9gw4gwloH8+5k1YPabeaI+efc2ih7YMqS rCwBhfjn7o5AdIT9yCZbGSr3EZDibtLsRRKp3AGHFZUjkjXp3k1oLVHRGVEOxWgbm8nd y8mtx/JCTj8w8HppXgd9Aex0TRJgFRB1fKs6U+3ycPz7HKIKz5HlT6DysJYi5iQUqJBi BxXA== 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=BUFU1rvAoQQuHmYKfAjMwfZ6G7c5tXUXACARv9ePCRylGDWahYm2EJ3MrtE9oXETYY 37pfPPlYQnu6mTj/22zXsNgtGuTXUm/W1FYnMXyCH5Cc5uX86wmNSdV7m28KHkISDMku JzN0ixNVala/0jMTECSHoWBC8Atp0IhJBJd+6CwCRFYFW5PgL6Qky2RdOxyUI1TPFLXQ +MEVAVP4iJmHseMRDJEcyFhMfBoFawWJmk/NdXPRzQrd7xFzu8KxjEWUk2aCobsI4p7f C3Q+15dbckeMkSgTV4hQOGkEODPCZESZqUMMUBMynWGuNieKT49I3Xeqg2vJl/p8D52r X9jg== X-Gm-Message-State: AOAM531vyahwSKW91OWmYEp3bV35YZ4qH1jGItOxxG5bi3LipK+aMcXX MtNhRNHUfNfS+xJ1iEqf2TsT/k9FCiGuug== X-Google-Smtp-Source: ABdhPJyBX+p4PMXy+KLmSid+3iTMmlugj+HtzloV1TTzlevyixsfjyCifSD0f6a2UeHpJzz32BDtEA== X-Received: by 2002:a63:6ac1:: with SMTP id f184mr8204479pgc.455.1643046524707; Mon, 24 Jan 2022 09:48:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:44 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH v2 76/83] vdpa/mlx5: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:47:12 -0800 Message-Id: <20220124174719.14417-77-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/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