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 DE87DA0093; Fri, 24 Jun 2022 22:46:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE31240E2D; Fri, 24 Jun 2022 22:46:28 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 16CC8400EF for ; Fri, 24 Jun 2022 22:46:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656103587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4Mt6TRwEnIBcB0T0o85+U/dAFVe/JyNj/z7ae/Tque4=; b=WfXPrgOaskblOfX/S684Xbu3ts9ofT3CY0fBH5T2Pr5bA0bFVMmUOooPQs42rPlSSS+e5o B3cXc6/q70gE1pCKiw1QD3KQnWGXi6LeBjOUtQlGvGx5hWstc+SVZnezwJdXYxhsGJ59+1 yi2d6kiNNkFEwGMTXcAEUTIXw5gHEAk= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-480-DwFFPRLiOxSfdVtSbudl0w-1; Fri, 24 Jun 2022 16:46:24 -0400 X-MC-Unique: DwFFPRLiOxSfdVtSbudl0w-1 Received: by mail-lf1-f70.google.com with SMTP id 10-20020ac2484a000000b0047f9f9c81daso1918881lfy.16 for ; Fri, 24 Jun 2022 13:46:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Mt6TRwEnIBcB0T0o85+U/dAFVe/JyNj/z7ae/Tque4=; b=mYsEggo5tvzrmUux/WsbNiGB3r+ZBAracPjG0+otpdgkrFSkpxdBtzS21T+gkISBmY oqZ3KBVW5ZYJpVGWmrQE/ghuH/VUuyqCUP2MFmdcc8/96+lU+DqCdOwoZ6GSG9flar96 i0jjGXYGhZ5USwWxxOKpfDpgmJ69LJgJg6z3Mc4D26/+vc/NCJ340eL+OB46fXoYGOZ2 WccEnwSJ0r26uG3wn9PNBsDsTwnFy7ndyom/H1V2IYoI/1UWYrFybLT8ax6X00N3k+de NgbldT53mZqN9ZBdpbnjPPBJDOCGCQF26ZN9VJmHNDHXvcA8kGQwUUEQ/FqKLhaF2PQ8 sqtg== X-Gm-Message-State: AJIora9tZYEexYs4f+F202o0yGgnjuPzOUq5ghw9wFwIFHMRQI74LkZ8 RCqKq+nQ3fPvXGAQu7cTY2/gTuxKVGilAkClvaZeEIs8Pm48eqJQgkZB5V1esg46Kgh4a0zYXvr pQFhsm3/9W0ITGz3SXpU= X-Received: by 2002:a05:651c:a04:b0:255:bf2e:72b9 with SMTP id k4-20020a05651c0a0400b00255bf2e72b9mr372924ljq.333.1656103582954; Fri, 24 Jun 2022 13:46:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t5CI1D3Lu7Jm5Ujbv6XRgU1wKBcru+yuV2ikx4ofbMAV+aMUum9ZdTseVhg5EJ6a37V1vSp6sRLutjUdZij2s= X-Received: by 2002:a05:651c:a04:b0:255:bf2e:72b9 with SMTP id k4-20020a05651c0a0400b00255bf2e72b9mr372913ljq.333.1656103582739; Fri, 24 Jun 2022 13:46:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Marchand Date: Fri, 24 Jun 2022 22:46:11 +0200 Message-ID: Subject: Re: [PATCH 03/20] crypto/dpaa2_sec: fix memory leaks in error handlings To: Weiguo Li Cc: dev , adypodoman@gmail.com, Xiaoyun Li , "Zhang, Tianfei" , Bruce Richardson , Ivan Malov , Jakub Grajciar , Harman Kalra , Ying A Wang , "Xu, Ting" , simei , Qiming Yang , motih@mellanox.com, Shreyansh Jain , Satha Rao , Stephen Hemminger , Kalesh A P , Somnath Kotur , Declan Doherty , Akhil Goyal , Nicolas Chautru Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Tue, Feb 22, 2022 at 7:19 PM Weiguo Li wrote: > > When function returned from error handling branches, the memories were > not freed which caused a memory leak. > > Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation") This is backport material. Please add Cc: stable@dpdk.org in new revision. > > Signed-off-by: Weiguo Li > --- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > index e62d04852b..3f8d4d213f 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -2037,12 +2037,15 @@ dpaa2_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, > RTE_CACHE_LINE_SIZE); > if (!qp->rx_vq.q_storage) { > DPAA2_SEC_ERR("malloc failed for q_storage"); > + rte_free(qp); > return -ENOMEM; > } > memset(qp->rx_vq.q_storage, 0, sizeof(struct queue_storage_info_t)); > > if (dpaa2_alloc_dq_storage(qp->rx_vq.q_storage)) { > DPAA2_SEC_ERR("Unable to allocate dequeue storage"); > + rte_free(qp->rx_vq.q_storage); > + rte_free(qp); > return -ENOMEM; > } Please rebase this fix, there was a new allocation introduced in this code and I suspect this should be fixed too. Thanks. -- David Marchand