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 A0A66A0093; Fri, 24 Jun 2022 22:49:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 431164069D; Fri, 24 Jun 2022 22:49:55 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id A5EC3400EF for ; Fri, 24 Jun 2022 22:49:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656103794; 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=hW+E+NjAKyEldaNlqKidQvKvV9N2TRqKDL/A5eFhpKo=; b=gUxfIdY7kRGJu0MXZUzv0p2gKhtWSKIE/8cjN+NSds8FUMgff+fNJUrpIsmroLJRU5lQgp ccBEesNONcmxH5FcFQIZuJO3JnTzrEPx3KLMXMk5bHVgIsRejZvLMeMq+ivLj1qLI6fd8E 09hkRBjf14j56mppUBY/SGlwGkgfdn0= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-hnl1Cv_6MSSkVVt0KYZHGA-1; Fri, 24 Jun 2022 16:49:53 -0400 X-MC-Unique: hnl1Cv_6MSSkVVt0KYZHGA-1 Received: by mail-lf1-f69.google.com with SMTP id j3-20020a05651231c300b0047dbea7b031so1915304lfe.19 for ; Fri, 24 Jun 2022 13:49:52 -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=hW+E+NjAKyEldaNlqKidQvKvV9N2TRqKDL/A5eFhpKo=; b=drg183yJSHE7iPOZJ1XLE6t4LPM17XoTeaeTALDVPFU6LKNns8HUIOsEzf1D/zosRX ar0TvEqLb7M+KeqC0wEJ5ZpdL01uaaogcLlAM1EEargVOeZU8j9y/fQ5DuHhPOm2yxQ0 +XV6hpCeKu+x4f/eOcnbYhDf5O5pBoFIXK8PiwMjHoNMj4Xe8plmOAkm3Lk3VsN2JZ42 K+pGgxTpieG2iToCup6ORIN1X29vt/GuHYVBkJfgibc5f4N15alHN+/OmxnOsqIgEIAn 2/6jh7sB1KIG2oIrdGgykvMCtLSgtzTlMIJuJE5OSkzpNyeXnC2Mi1Nf8DqSuEdOF54P EFSg== X-Gm-Message-State: AJIora8nEP5dazCsz41FA7rj5dLWuCW7gas9ZST/fF6YdeQ3r4OShXiw mKs/FrsGEpk/zO4roKDW5S6fyUU1Kc/NaNaCMUWVhaQkOJjyC/U3h/w7sZK25SSY52Q/ch0I/ep 6FmPsQ354qm/atC2SryY= X-Received: by 2002:a05:6512:3c8e:b0:47f:b6fa:8da1 with SMTP id h14-20020a0565123c8e00b0047fb6fa8da1mr482422lfv.553.1656103791637; Fri, 24 Jun 2022 13:49:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8HtFobk/0g/kfK+PBfB2rRvXLdxQTMqfIzqSMmA4MENPbWEhOf7nsxGvebDcCXiaJjUsQRJZwP3WU/ThXNJw= X-Received: by 2002:a05:6512:3c8e:b0:47f:b6fa:8da1 with SMTP id h14-20020a0565123c8e00b0047fb6fa8da1mr482402lfv.553.1656103791446; Fri, 24 Jun 2022 13:49:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Marchand Date: Fri, 24 Jun 2022 22:49:40 +0200 Message-ID: Subject: Re: [PATCH 04/20] crypto/qat: fix a memory leak when set encrypt key fail 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: > > We allocated memory for 'in', we don't free it when AES_set_encrypt_key() > fails and it will lead to memory leak. > We can move set_encrypt_key() ahead of the memory allocation to fix it. This move seems to fix the leak indeed. But this change does not follow the pattern used in the rest of this file and I don't feel confident enough to accept it without the driver maintainer opinion. -- David Marchand