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 22C01423C7; Fri, 13 Jan 2023 20:04:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B0B5410EF; Fri, 13 Jan 2023 20:04:03 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id E2E5340E03 for ; Fri, 13 Jan 2023 20:04:01 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 36B7920DEDEE; Fri, 13 Jan 2023 11:04:01 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 36B7920DEDEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673636641; bh=BjBWYEvwYi7izNqoQ9U5EtLpiLEwo7Pw29VexIOQpas=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sXBhD6dL/opdZgKn044KANTA2p3bWkudrSIlWTBs5QxjaynLhJhWGC3CqhnNXw3Sy PpMJLAozjJmDvHTtbkz6kIG0FX4w9pBDXiK639b5zlruDQ+LIEUrxsasKhwfkAiAo2 lfd7CrGadkH/+2qGCDR1DBM7OOs/jAIpIRYZFaTY= Date: Fri, 13 Jan 2023 11:04:01 -0800 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, kai.ji@intel.com, Pablo de Lara , Ciara Power Subject: Re: [PATCH] ipsec: remove unneccessary null check Message-ID: <20230113190401.GB11082@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230113184426.68063-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113184426.68063-1-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Fri, Jan 13, 2023 at 10:44:25AM -0800, Stephen Hemminger wrote: > The function rte_ring_free() accepts NULL as vaild input > like free() and other functions. > > Found with null_free_check.cocci. > > Fixes: 16d6ebb65d59 ("crypto/ipsec_mb: fix null checks") > Cc: kai.ji@intel.com > Signed-off-by: Stephen Hemminger > --- > drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c > index 71e02cd0513d..3e52f9567401 100644 > --- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c > +++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c > @@ -139,15 +139,12 @@ int > ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) > { > struct ipsec_mb_qp *qp = dev->data->queue_pairs[qp_id]; > - struct rte_ring *r = NULL; > > if (!qp) > return 0; > > if (rte_eal_process_type() == RTE_PROC_PRIMARY) { > - r = rte_ring_lookup(qp->name); > - if (r) > - rte_ring_free(r); > + rte_ring_free(rte_ring_lookup(qp->name)); > > #if IMB_VERSION(1, 1, 0) > IMB_VERSION_NUM > if (qp->mb_mgr) > -- Acked-by: Tyler Retzlaff