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 06A52A034E; Wed, 9 Feb 2022 20:21:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54C484270C; Wed, 9 Feb 2022 20:18:34 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 5A9E642731 for ; Wed, 9 Feb 2022 20:18:32 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id d15-20020a17090a564f00b001b937f4ae2fso800835pji.4 for ; Wed, 09 Feb 2022 11:18:32 -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=y6RIErqxVOQ43JUx/cwksCqAby2OSz+JvQ8gBUUY3xA=; b=tpvrIFue2iTp0TFsGNsAmB7oZegQDvewXR8hqzH/g1MLdql6+iJhybnr4gcmsTfvN0 4eVFhWdmJVbNjH/AewlxISqm177u20jehqAMAQ7uq7+X9ZXic9Wqq1bKmUhyNw5Zf5D7 IGH/wvN1NKOLF8KbOOvDwgXZgPDs91o3Pqyx9Udm+qLtJu/jMYphFqjvojeqHgu9nPF6 xRpinnArg/HDw1LbBaf6L3IDwHGvgHeNhBk5/ujbsIE9UeXd8SqlLBAPBmO37h8mxUq6 oY6YEfu/WMrfWdNnplrYW40oiolpMHTmiU9yL/jo1tZjt9eWBUq0VaNgmzAxH4y3pSW7 SWeA== 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=y6RIErqxVOQ43JUx/cwksCqAby2OSz+JvQ8gBUUY3xA=; b=tzlbIBoFLuBL2o9z35/zFZEHPi7s+QzFrBgfbgS4Az3ibxQqrpIZyagoNjsC0xpwnz LRznE9oASZHVPTnMoSjMuuJsWVQ3cvznayquIg8foN1ZPr/J9Hz8psGeh3/jOwoPpiFn lFkfwbnn7DHnngRyc6DhuNMDTZqjY9yDAkeagwJBVwe1SZosv1tq8yQ70aPqbFnjCVl2 U4C1M1+2ucCMIaHhqJbg8/L49ogywEk11Eci3xEGNKQydMnwN6E6XfpctXqA12KvtdnG 803z/Q/JGdz0esdMhfzDQDR1dxnB9kXDfu9MSraDDoini3KMb310/zZp/74nvM4//ufZ ipOA== X-Gm-Message-State: AOAM532ANWJk42M0/OeqKB6MPsoLR3WMExtg9Oo3c5kHNItCa1rEafg8 pby1UlH2rYmnc3L4RoTuRCwCOr5C1cc4KI5nLng= X-Google-Smtp-Source: ABdhPJyqkXEhxdRIcvsidiVRq58BvXbIwGAMKu3+lF+uCY/BZ2vIS8JupRXkv10W4bZdCwiHREiCMg== X-Received: by 2002:a17:902:eb45:: with SMTP id i5mr3645805pli.75.1644434311240; Wed, 09 Feb 2022 11:18:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:30 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Liron Himi , Ori Kam Subject: [PATCH v3 33/36] regex/*: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:45 -0800 Message-Id: <20220209191748.377729-34-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 Reviewed-by: Liron Himi --- drivers/regex/cn9k/cn9k_regexdev.c | 6 ++---- drivers/regex/cn9k/cn9k_regexdev_compiler.c | 3 +-- drivers/regex/mlx5/mlx5_regex.c | 3 +-- drivers/regex/mlx5/mlx5_rxp.c | 3 +-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/regex/cn9k/cn9k_regexdev.c b/drivers/regex/cn9k/cn9k_regexdev.c index 32d20c1be82b..56c862c5a76c 100644 --- a/drivers/regex/cn9k/cn9k_regexdev.c +++ b/drivers/regex/cn9k/cn9k_regexdev.c @@ -256,10 +256,8 @@ ree_dev_fini(struct rte_regexdev *dev) cn9k_err("Could not detach queues"); /* TEMP : should be in lib */ - if (data->queue_pairs) - rte_free(data->queue_pairs); - if (data->rules) - rte_free(data->rules); + rte_free(data->queue_pairs); + rte_free(data->rules); roc_ree_dev_fini(vf); diff --git a/drivers/regex/cn9k/cn9k_regexdev_compiler.c b/drivers/regex/cn9k/cn9k_regexdev_compiler.c index 935b8a53b459..60f1c1b4c4d8 100644 --- a/drivers/regex/cn9k/cn9k_regexdev_compiler.c +++ b/drivers/regex/cn9k/cn9k_regexdev_compiler.c @@ -214,8 +214,7 @@ cn9k_ree_rule_db_compile_prog(struct rte_regexdev *dev) rxp_free_structs(NULL, NULL, NULL, NULL, NULL, &rof, NULL, &rofi, NULL, 1); - if (rule_db) - rte_free(rule_db); + rte_free(rule_db); return ret; } diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c index e5a12fb3cc4d..48e39f6b8844 100644 --- a/drivers/regex/mlx5/mlx5_regex.c +++ b/drivers/regex/mlx5/mlx5_regex.c @@ -127,8 +127,7 @@ mlx5_regex_dev_probe(struct mlx5_common_device *cdev) if (priv->regexdev) rte_regexdev_unregister(priv->regexdev); dev_error: - if (priv) - rte_free(priv); + rte_free(priv); return -rte_errno; } diff --git a/drivers/regex/mlx5/mlx5_rxp.c b/drivers/regex/mlx5/mlx5_rxp.c index 5ead3ca341ad..99db1e4a865c 100644 --- a/drivers/regex/mlx5/mlx5_rxp.c +++ b/drivers/regex/mlx5/mlx5_rxp.c @@ -166,7 +166,6 @@ mlx5_regex_configure(struct rte_regexdev *dev, DRV_LOG(DEBUG, "Regex config without rules programming!"); return 0; configure_error: - if (priv->qps) - rte_free(priv->qps); + rte_free(priv->qps); return -rte_errno; } -- 2.34.1