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 491DDA04AD; Mon, 24 Jan 2022 18:54:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DAF824282B; Mon, 24 Jan 2022 18:48:45 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 9871F4299C for ; Mon, 24 Jan 2022 18:48:42 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id n16-20020a17090a091000b001b46196d572so502549pjn.5 for ; Mon, 24 Jan 2022 09:48:42 -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=c1GrRG4Ck4OMo8G1Us6LuPxeEg45k1bVfZwOqYl58ec=; b=2kPNr/ZmOaasnfU9wMCe1+tJNqcNOOqhUGpd51CCmM52MWblhdnKtQeFgTOzkbBs/O WJ2jSB0E+XkZRzo3VHRXh7pVA6IIRPdZIjcv3yq3DCADbg79VrF1cUsuuyhinC8ne6cS dAFWRV0g0ipFjdXDMB/kryF2Xv/YkOKHInO38tipzzKRawsOVN1AW11DzBuZKq4WK3xK Yw0N24faNkbezIIPWtHzan3/eWFbPbMaGKCsu50Vb0bLwSfwLwM48RqlLyEIOCkU2PJ9 KfugLlGYXQjLDkANMHNnP0bNZb26hlHOqxtLr4Ebn+mA3KiKd04tjxms39bfDqLy0C+y qAQQ== 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=c1GrRG4Ck4OMo8G1Us6LuPxeEg45k1bVfZwOqYl58ec=; b=dgZ8117fY+eExRn//0xlG38EQ7qLclUh6imnA/GPaD+yl/I2mQFbrFmUG0tVy/kLAx W1ZZuSEvRFgABqqkE10miV2x7fYOy96WhOE0UYnmIrOkFkOEgSm8mD2Lm9p6MaitVZH/ NRleaLrQ36cblKpPZK2iLuuTRlil9lCmQgvH4JCozuZ3ye/n6bEbYIJtHhIC+WwRvhkW YcP9ujpGWz9D06rIb4v7AG2VF/1ade/ALgTubDnxQbxnYICGnxXox3gPkrV+P5lZGmlK +eNZJVjxCQE7d2fc5KyUpjXF3AMdHPLLQntWq/48PYsxycafVn5eDXSaMzxIyAYSU0Ow KWNQ== X-Gm-Message-State: AOAM533XHbPsplCEscW2awL9TCAJuM27orLyWtee8jLSvpGRAoQ7z2Xk faAuLIEz0k5qxuKI9tooDTgbQ7ZUxK+zow== X-Google-Smtp-Source: ABdhPJzNgaeFkPs+YTNmGvcQwCk6OLlxHr/24t/bKga+3lqxW2U/fEqmq2fPD5EJ9+QTJIhZ9YK13Q== X-Received: by 2002:a17:902:b586:b0:14b:6bab:55e3 with SMTP id a6-20020a170902b58600b0014b6bab55e3mr1167993pls.43.1643046521647; Mon, 24 Jan 2022 09:48:41 -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.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:41 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Liron Himi Subject: [PATCH v2 73/83] regex/cn9k: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:47:09 -0800 Message-Id: <20220124174719.14417-74-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 Reviewed-by: Liron Himi --- 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