From patchwork Wed May 12 14:43:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 435625 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp5089576jao; Wed, 12 May 2021 11:46:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUqTEaIJEWPEQTQrNmJr6DsAMeYjptMLTqV0qZFNEfDCeBDx9gBkPP3pbgIoDuvBRkRyuO X-Received: by 2002:a05:6638:10ec:: with SMTP id g12mr33583243jae.13.1620845204040; Wed, 12 May 2021 11:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620845204; cv=none; d=google.com; s=arc-20160816; b=LcdfS+yyC7USw5SpJQVRyhLbKsLft1xoVZu27A2tw0nFTJLLsxdwwY5KweEE5lgGmw 6U+zpKLritr98iqkyNPReR4CcbSWADsctB1Q/hs3qh/168EvicmyutzxxJXrR1TLTZ6d eIB/gvtPMBD/Q/eH//ebecgfUGeVpe1PV/LqkyeRKaaMPDshGuBfSO1j2z+/pY1bJ5tn yikeSk0xuolXrPGD5e56iIKuUdz+OkB8aLTAOYtdA4FFKZgs9w3rpwqU5Qu6ioiFkt6q EKI+62bJ58XQJV+aT8O7GryTSJQgJxsgEy7fapU2Mi3f0HeJO+N4MJcytk5FUKOJaMwQ 8mEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nDgRzc2Z0Rbsm/MINc4KTiv11KZDkCmpyVpWgovhaJw=; b=j3oVlHDZowXkBMYlPOKEGQK1LvnujhjpgPEBASCBkM6nzDei0IwRlLH47koKF8vVhs BT3QiBN8XX6Ft6WMZxyJNyAcOOHcQhwCOrlrfjvjZU0C0/3xaz22Ld8AHXwD82e8N65v 21M5zeeL2yY6qq0dEzJpkDzh2KxoF0f9D5ts4AjAq5AIm5EkgYeyk56DNnguW6jQkj/s 2Zou2q+q97Uy39tItpoy2M0URnAaZhVtgbyAfR10O/6Kv/XK1xwxd5z/YBH9lbJWh6GI mho2gf3AAxdWd9uYl6VZ3c4h+Px/7cILqtrcsLAhXCsZXgIrPbV2pD5MClm4uSb/oRrM BtCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y8eBzeA7; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si330223ior.12.2021.05.12.11.46.43; Wed, 12 May 2021 11:46:44 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y8eBzeA7; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235749AbhELQhU (ORCPT + 12 others); Wed, 12 May 2021 12:37:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:43414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241727AbhELQ14 (ORCPT ); Wed, 12 May 2021 12:27:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5958C61420; Wed, 12 May 2021 15:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620834938; bh=kqBPCLw3fTjQTbbrkRgQ1iSU7cna6dND4Gyu3RXdw9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y8eBzeA7N1AzfQF9/LNyYjqeoXeBssWKjmdicMsSo37n7YC9u+w8PGunXTRSB8YXz NSg3ev8RmL8+WdVFdAwlCbPCGeIy9m7Dl7KKeNidALke5rzMg0wQdthhIHcn03Ffur qA2jffb0qP1/fYIPteTe12o3UwFiEIN6z9ljxADI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Dan Carpenter , Corentin Labbe , Herbert Xu , Sasha Levin Subject: [PATCH 5.12 143/677] crypto: sun8i-ss - fix result memory leak on error path Date: Wed, 12 May 2021 16:43:09 +0200 Message-Id: <20210512144841.998613218@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Corentin Labbe [ Upstream commit 1dbc6a1e25be8575d6c4114d1d2b841a796507f7 ] This patch fixes a memory leak on an error path. Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c index 11cbcbc83a7b..0b9aa24a5edd 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c @@ -438,8 +438,8 @@ int sun8i_ss_hash_run(struct crypto_engine *engine, void *breq) kfree(pad); memcpy(areq->result, result, algt->alg.hash.halg.digestsize); - kfree(result); theend: + kfree(result); crypto_finalize_hash_request(engine, breq, err); return 0; }