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 1E5DFA034E; Wed, 9 Feb 2022 20:19:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9068F411ED; Wed, 9 Feb 2022 20:18:08 +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 E800141143 for ; Wed, 9 Feb 2022 20:18:05 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id i21so4486568pfd.13 for ; Wed, 09 Feb 2022 11:18:05 -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=OH+xT9UjipwGh38vs3LD7vYE/uaXbjFTCF712uUpS5w=; b=30CVpRVypS+pEEDf5ECU1kmZ+og3FdaicBI8srFu3PAyj1XFe3rebdygDnZ9fvO9DX JNmQurf+cBfNR/DaVhZjDf9MW4/HuXzQQokp3ItCmm3APwC09Mx90bshAvBmSJyKbVlD f97ViNqz6g9Df6WlGbnf7uP8RNwqGC9Mnnx9MfsAS19Iqnt5ltMpcuRnSErEN4MN4fCZ jAK7pd6e79hfrKIRZ2V+FL/GlsDJJVJ11zvgLu65cB+sOvFlzZI7+H8zAXYrLCOTNIa7 70DhANjspHt/4b5sW2uW9YvVk73VZ6LcdwEEb6Ms67c+JHG3+wHmJ49yw+vUllkPViG3 nUSA== 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=OH+xT9UjipwGh38vs3LD7vYE/uaXbjFTCF712uUpS5w=; b=sDyhfpqrj+GAJHwKs6cXanQD8JRHkbhIIW/rAOku/cszeiURnl/TGNF4nBRgallN3g 2epSyMzRhpJkOqRY9CbmASgc+5Gll5Pwif1FEZQoi+PBYb6zu9dhX+6Fd5xBS9dwsFkQ XBb63DlFrjKNVUmjSiRybRpSJlgCLkZyScJJFxz4WyqlfgJulJulfbFNv46xuCwSH3Wj 2b753dhS3lalKDPbZxMDsxV8St5EYa3CtGmZWKTZl9dJOlJvCa/WL7ZkiiXkC1HNN0wk BoyTq+kZBNhNKrejgZVMbdfCELe5l5cG3w7cA7xRurbk0Fm7nk4hXrizx419RsWQj+48 /1+w== X-Gm-Message-State: AOAM530pVQTxgXy5mEXTZ7lXfgeSn9nFz+yxhxscEZcu0SXjZuvB0Sxi 9VPUJ3RneLo491sEgKzqkBb5nAkBoMtyPnU8 X-Google-Smtp-Source: ABdhPJwABf1Yw0HKfnJBxX/sJD7lBJ6A/DH7SkWVypZ/oIdcqB4FO8PJsCpQyROOolpBdNV80MM63Q== X-Received: by 2002:a65:620c:: with SMTP id d12mr3060906pgv.394.1644434284896; Wed, 09 Feb 2022 11:18:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:04 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad , Fan Zhang , Ashish Gupta Subject: [PATCH v3 11/36] compress/*: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:23 -0800 Message-Id: <20220209191748.377729-12-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 --- drivers/compress/mlx5/mlx5_compress.c | 3 +-- drivers/compress/octeontx/otx_zip_pmd.c | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 82b871bd860a..b12951da8b51 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -146,8 +146,7 @@ mlx5_compress_qp_release(struct rte_compressdev *dev, uint16_t qp_id) void *opaq = qp->opaque_mr.addr; mlx5_common_verbs_dereg_mr(&qp->opaque_mr); - if (opaq != NULL) - rte_free(opaq); + rte_free(opaq); } mlx5_mr_btree_free(&qp->mr_ctrl.cache_bh); rte_free(qp); diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c index dd62285b863e..26cdce60a859 100644 --- a/drivers/compress/octeontx/otx_zip_pmd.c +++ b/drivers/compress/octeontx/otx_zip_pmd.c @@ -337,8 +337,7 @@ zip_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id) if (qp != NULL) { zipvf_q_term(qp); - if (qp->processed_pkts) - rte_ring_free(qp->processed_pkts); + rte_ring_free(qp->processed_pkts); rte_free(qp); dev->data->queue_pairs[qp_id] = NULL; @@ -423,10 +422,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, return 0; qp_setup_cleanup: - if (qp->processed_pkts) - rte_ring_free(qp->processed_pkts); - if (qp) - rte_free(qp); + rte_ring_free(qp->processed_pkts); + rte_free(qp); return -1; } -- 2.34.1