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 59603A04A6; Mon, 24 Jan 2022 01:07:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE8BC4283A; Mon, 24 Jan 2022 01:05:50 +0100 (CET) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id 22B7E42832 for ; Mon, 24 Jan 2022 01:05:48 +0100 (CET) Received: by mail-pg1-f178.google.com with SMTP id e9so13659631pgb.3 for ; Sun, 23 Jan 2022 16:05:48 -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=17GHwTQ6O6FJHD1CzhrykCCKE4ozLoVb2ith96X7NybTTqtekxg65Bp6jiSsiIrrs+ tA9gLTv7ApupOgELK6rk130q6nfQMYPbnSegduBdsm4AAM/Zi55YUTwbEyo9MYz+eQE0 dG/5+WD90IlBM481uCOxKf/iG+TGwAn3WpuCsGSf7hfAAZDKnIMY7ZeAE6FMnGBxdPYa px0Hn3xDt+QV7ATnkl1gcPF7E1y0l+5vjtaZwrX+uJBq6caj5icPZ3vY/OxKsIM7gM2G KDNULVm1eRmUO+jrRg+l7pBdv5uKHN2dS8Qj0ZwjskzR6XLnYAjOpAeKxaJI4xQwYMjh mRTQ== 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=a7ZNf1XOwP1OfFp+yD3LKqeH9vr2qihCz/BNlrBChfd1tQt/Hb3xBC4k3Ex8vs/rAP 6aqFlGY+MfDBSeRB/1xyTVKJoezVwigNDFjaSq0YfEO4QGv8X2+6ChPaZNg0T5yJz5jf PmLc9ELcB6HXQnakdSuFHAdRG0r9K1AJ5unXRzoF40j9hOgh4MOGdjupLdqKuGBuOAqH OmiqRtGxCAq//PoPdIXkvoEc9LtyvECMm6hynD3Zhnu8lfqIu2FLvril+DHLwLjo7KZ/ nzGStlwSSL3IeUVlU/VUXF59usyQ9GQkmpk5q/QvlAKAb0yfamxjVeD4JrqB4/4OeakD LG6A== X-Gm-Message-State: AOAM532HraPVqr0XPQNWalpWNcz38EF6hIxu8q6Wv2WbMqv2vr+kUfvz tVwKUPkLyBci7+/RAAANSPEd8F30HJ9lsw== X-Google-Smtp-Source: ABdhPJzf6wPiNhjGfCVsmP9UTSK080USMqz1Mu6Ab4qLt4j5zbY45CxDOqpvBGEL4e6lnFiDdI944w== X-Received: by 2002:a63:4f0c:: with SMTP id d12mr10146954pgb.133.1642982746806; Sun, 23 Jan 2022 16:05:46 -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.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:05:46 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH 24/82] common/mlx5: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:20 -0800 Message-Id: <20220124000518.319850-25-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/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