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 8283BA034E; Wed, 9 Feb 2022 20:20:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF1D2426FC; Wed, 9 Feb 2022 20:18:21 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 356C6426F4 for ; Wed, 9 Feb 2022 20:18:20 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id y17so3067110plg.7 for ; Wed, 09 Feb 2022 11:18:20 -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=mJDiEhqb7Owum5WLQHPbcPtbN9eVH8ux630ot/K1frA=; b=6hZbQUl4tLOMoLk8X1XKSWE7bX28O8t530z4iHdETuXIoHsKLqlrFIH+hD9Vb2m+fM BmuqlsbLRfWaVo9Bl+HYrj9AOAHXXaMSs0I6wRdrSdcgUyhUAZ0f0LrDAGEaYRJwzCny RBdcWZAFsob4EJZD5n2Hod/0pynhGfpcMZtKAuJJFQStBCRmtKNUjQl0PE8IDuxQWBDq QxsQYy4YCpVUM5AT9OYbJNS6oC9QDTq0NPruAE+xIP9Zn9577ttW33ZZmuUamY3QqauV GNG0H6HyhtXhGvjmet4/c5ZydIAykZkoEvqWT597toISp/EiXkz/WbirKE5axOA02uPA CHxA== 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=mJDiEhqb7Owum5WLQHPbcPtbN9eVH8ux630ot/K1frA=; b=nHgI0k6/1dcYjhYUAQ+zGLQK2qeS3o7X2yhI+0Ocgd4lAh3BOpeG/XV+pEXk3Cyb9/ J7Li+mrk2giSsbF6jdf9LUEHsSu0jbfvV2Edsf1erpNOYk6avsaOz2+uJlLSUWPaCq1R d1WxWb1uFQr6jtQ7pGhhD2zSCSaj5NnNr/if+Uo6ohBY/a2LuL4dkwj062uIu5dpiGwj 7CU9C3iT4SPgZuDekdW3o83u0f3s1NzNJkNfGNa1oa5aWR/tO9bQree/3kTUE3HmavC+ moGk+/EoJStES5TtD9oQ1++tszGnLjrJ8y1IY+Kiy0H9kxtr2Ij+pnO9TscHg8WtIiOn aJWA== X-Gm-Message-State: AOAM531tEp2UDR6R+r4fJXNdRbH4wjUBYAMQHfOGjD3A8NKwwh2JDqCr S9M5Ak1m4ONdt4AuUAli33R9fFb9OYiXiIsSZTg= X-Google-Smtp-Source: ABdhPJz1QG1U6NLQO1fDV0P+mEth0qCesa7j3U4lBmpIi3dBaVlzKsot/9fQyjpmHNOaMXf/R9S/1g== X-Received: by 2002:a17:90b:4c8a:: with SMTP id my10mr1005466pjb.97.1644434299150; Wed, 09 Feb 2022 11:18:19 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u16sm14378401pgh.54.2022.02.09.11.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:18 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH v3 23/36] net/mlx*: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:35 -0800 Message-Id: <20220209191748.377729-24-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220209191748.377729-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220209191748.377729-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/net/mlx4/mlx4_mr.c | 3 +-- drivers/net/mlx5/mlx5_flow.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c index 2274b5df1950..e95f45aa3e95 100644 --- a/drivers/net/mlx4/mlx4_mr.c +++ b/drivers/net/mlx4/mlx4_mr.c @@ -471,8 +471,7 @@ mr_free(struct mlx4_mr *mr) DEBUG("freeing MR(%p):", (void *)mr); if (mr->ibv_mr != NULL) claim_zero(mlx4_glue->dereg_mr(mr->ibv_mr)); - if (mr->ms_bmp != NULL) - rte_bitmap_free(mr->ms_bmp); + rte_bitmap_free(mr->ms_bmp); rte_free(mr); } diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index d7cb1eb89b94..179cc3b30378 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -7008,8 +7008,7 @@ flow_alloc_thread_workspace(void) data->rssq_num = MLX5_RSSQ_DEFAULT_NUM; return data; err: - if (data->rss_desc.queue) - free(data->rss_desc.queue); + free(data->rss_desc.queue); free(data); return NULL; } -- 2.34.1