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 013E2A04AD; Mon, 24 Jan 2022 18:49:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A97E4287F; Mon, 24 Jan 2022 18:47:53 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 9355742802 for ; Mon, 24 Jan 2022 18:47:50 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id d15-20020a17090a110f00b001b4e7d27474so517166pja.2 for ; Mon, 24 Jan 2022 09:47:50 -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=XQ8I6+YgMTuR5SdNcCmgWKROtA0UZVrH8etryIV5X+o=; b=hWZWNx+GQMYuBmFnCtfrNQiJu3gn1pgz6M0CV6Vxa1+uVLo4XAoHlKH+49RIBRmne8 AplRNK0YUMgpyzfEdCOKKBn7gJNyXY/NjFrnt9VljanHvRlbNDs/j8zwFIx+aDQ3GTFU i89awZsGXgxmz/VMrflFeOc3i7b6ipWA+Otzk2iJC8pFYX58jMKlhMETcClgKaMp0lP8 L0Mb0WA9zF7myYsUZNsvcjjb0wMBiPSHwd5lBqkyHSjRhtco+nhNM7lSv/WT55o8bZ3r sMY5+mKGnpSVcq+4Uh91luOqkosc3wlgt2aAhuP8rZYqMjaqJEni0NtmbsPf3pJMAqRh UofA== 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=XQ8I6+YgMTuR5SdNcCmgWKROtA0UZVrH8etryIV5X+o=; b=aHjgy1em68QL36JuXWEiadkQ2ul9u4z3PUYpyLvr0CeXiq/gyGKhO+AWbRqAowCuly 5R4BjTH1vYB4463ZNR1ZRiDR0wPEnnVJIWxPj7hTgqfEObDPiQ5PtkNEZ29uc6vyxWH9 nv6p9HcBcBoxGmRCNhR8SfdL4Scx2lEzxPHj1H2yIe5jiBeEdQrQhqGtr+MY+IvsFapz fnHAYIwbzKrsh5xspqhcoEJHSBMkHfVdHZvkJTLdqzSFzqDdvt9EL+C76LUZaMQAtAVW RBgXuXPzspH63TfKyep7U1D4NplxJo9+aTfHXWKPlrt1K8Wb6FfrGIC8Jm2rIpInvYQW +wrg== X-Gm-Message-State: AOAM5314ow6GZMmvg9FX/sGDSGYhq5msgIf5vOpo+gLEwpA10KjKqupa D6QvXBAGfcYsGFEzjDsm/e7vMxJ3wApWig== X-Google-Smtp-Source: ABdhPJw2LmLU+x/DtPeJW/+xB5N3rUqizYgbA/GEZnHkIkJSL3CCI4vOL1/uVBP8G9L6pthDMKcr+A== X-Received: by 2002:a17:90b:4d11:: with SMTP id mw17mr2979529pjb.100.1643046469344; Mon, 24 Jan 2022 09:47:49 -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.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:48 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH v2 25/83] common/mlx5: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:21 -0800 Message-Id: <20220124174719.14417-26-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/common/mlx5/mlx5_common_mr.c | 3 +-- drivers/common/mlx5/mlx5_common_pci.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c index 1537b5d42879..07f76a10655f 100644 --- a/drivers/common/mlx5/mlx5_common_mr.c +++ b/drivers/common/mlx5/mlx5_common_mr.c @@ -516,8 +516,7 @@ mlx5_mr_free(struct mlx5_mr *mr, mlx5_dereg_mr_t dereg_mr_cb) return; DRV_LOG(DEBUG, "freeing MR(%p):", (void *)mr); dereg_mr_cb(&mr->pmd_mr); - if (mr->ms_bmp != NULL) - rte_bitmap_free(mr->ms_bmp); + rte_bitmap_free(mr->ms_bmp); mlx5_free(mr); } diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c index 8b38091d8741..458630351cd1 100644 --- a/drivers/common/mlx5/mlx5_common_pci.c +++ b/drivers/common/mlx5/mlx5_common_pci.c @@ -97,8 +97,7 @@ pci_ids_table_update(const struct rte_pci_id *driver_id_table) updated_table[i].vendor_id = 0; mlx5_common_pci_driver.id_table = updated_table; mlx5_pci_id_table = updated_table; - if (old_table) - free(old_table); + free(old_table); return 0; } -- 2.30.2