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 35FF4A04A6; Mon, 24 Jan 2022 01:11:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 287724293F; Mon, 24 Jan 2022 01:06:42 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 8FBF842876 for ; Mon, 24 Jan 2022 01:06:37 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id y27so10095771pfa.0 for ; Sun, 23 Jan 2022 16:06:37 -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=/N7Veby+xkF8KLtKEHfcbxhJiNWlFaaT38sXLrh3ndg=; b=PigCbOfQ5Rxa2IJFE55TZe1saenQ+4iXQ8zr7779P+TGM4OVrLnzfnWlrvEuI+DfFc Zg85Xx3x4qGfHFSdRneLRXVKj0eB3XpHtF6AiEgvroF071FYcoD+P9l1AIRRwfNnXa02 GFNE5tvWyfbhg8UfUJgTBV8ZQPeXVwpYn5gs2/StLkPSF7K9ZlpA6Fkg2QeMaKLDosRj id09e2VNfqGQc3j8J4uZex9e+L/RWYVGTCfUZ/xND4SrQ8DnJSUA9p/vXBEqE00kk7DJ wlmjk8vilkMUoUCawK6zKMK4bIwzqlcK5NeA9gfgcf/kdQVirCQr3UQPIkkiBb3x1PDT FpqA== 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=/N7Veby+xkF8KLtKEHfcbxhJiNWlFaaT38sXLrh3ndg=; b=hN021xRSbVBzGPidrFqK+AgEmSKqiVW23b7GeNJxAM8aviv0E7sYI7vSKGj8Z+uWqc TiVDEkCSw1WWlwycbOz+ZS/qiDKWjMXoHsRb+XBy4htLBjZIsuv7xsDchhJ62V7yKCi6 VKjO1DPzbIyHZo/qYJhIGlO4q7GDN6vgiISqUH+G2OnYVVk3MxNDGtJEK15JXc5KExsw WDTsLEDu9rytRWbfk1iEkafMRC6G6P/3/RbMY3S8nl6c9AgJw5RhjbrfGXj6A3aGmjIE +WT/j3/1xeYR8R4waKa5FnH57lHLaqfceH8D15hKG16K9TzOT5jZ/fxysr/VRA9fUKyI paOg== X-Gm-Message-State: AOAM533yZROB+rlAQs8HnIWI0nCUx0xX/9uxsv6NfEH8OiPQeKXmTvjH c9rYPpWY9LNyUgOCl6XfoQAUTBZ1afsozA== X-Google-Smtp-Source: ABdhPJzr4L7AToWzN5Yrq6dUaBYvmIRiuOIO5L10pBjORSiPsu+xmFauUpMGggi/qsPH0JXFnluKgw== X-Received: by 2002:a63:1562:: with SMTP id 34mr9925393pgv.15.1642982796599; Sun, 23 Jan 2022 16:06:36 -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.06.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:36 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Liron Himi Subject: [PATCH 72/82] regex/cn9k: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:05:08 -0800 Message-Id: <20220124000518.319850-73-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/regex/cn9k/cn9k_regexdev.c | 6 ++---- drivers/regex/cn9k/cn9k_regexdev_compiler.c | 3 +-- 2 files changed, 3 insertions(+), 6 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; } -- 2.30.2