Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4584406pxj; Wed, 12 May 2021 08:41:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlE74F08xY/QVNv9gafoi0neZIKit8mp/0sQ+p62R5VDb+lXAL3emoOGY6Yt/JB5q59fKL X-Received: by 2002:adf:f152:: with SMTP id y18mr46275521wro.77.1620834083161; Wed, 12 May 2021 08:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834083; cv=none; d=google.com; s=arc-20160816; b=vjXRamVGal77PB+llIBlLXBVbv5k7WLf2/LrD6UkBuXbrETmugltIuS+UV/koE+Dkh sjJ0mOYvrZJQabcy130GGL6k5qww4BXRHe8fuK+E5Y06r2976BvqwOw+iqYzEV60823I +mRNN35abyyBdWzIRTcD6C9uE2AAGbiv9Mce/abu0AbStpciYq26gBJrFGd5LgjOGwt9 +iuJ/hX2reysMbW6GXbpiJDODDsS6EtoK//Akbnso3v+CH/smpQDZPTekxrnxfzh/mqc ogJNPeQoRI/USPq3QFXfpR39WzY0ggZq1n3yiLl6cyGovOGxNSyBPHwhkTtMRky9hO1u zMWg== 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=SmhocpJPqYCuJGQr+XqsBnzimtD32z3Gr+yHhXcgprk=; b=JSvQGblQllksooGDl9G5awCi9v7FvJvGUN3NnHSutdEfCHqWQc+JIZLWo9Za+FrY4l /1PpyxYNVsuvQAE5IJUhybhgL+kN5cVCQzOpnJeZq/1G/esEqsFEa/+2eJzJqYWtjNQa wqNeGEokABUDN5EDlmfi0Cxiw1kJekRamIO6qQc4Je590yWpwR++AX6zcsmB4Q1c79XR cpdbQIlg5cXnjNy+WTq49HdxsXemqd660wsnPBOz3rYQlwi8CDaKgOBXKbviyJwW87KO bfgZKliE1SlJ7e9qzB9ZNyGId4kql3yc/2NnhE1tzoW+zftWoJ2exNCF+l7ddYadDbdd RjyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Qs712h8/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 n2si99730edi.195.2021.05.12.08.40.59; Wed, 12 May 2021 08:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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="Qs712h8/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S234983AbhELPjy (ORCPT + 99 others); Wed, 12 May 2021 11:39:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:49670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232734AbhELPRW (ORCPT ); Wed, 12 May 2021 11:17:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8C1876143E; Wed, 12 May 2021 15:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832033; bh=eMf4jyMm8BFS+tTjdkDT6gTNKThouwd1zoQLiyk8vk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qs712h8/mW9Vz9z4LKtQlds6IHx8/vwTl6alzEpOCegEuqnF4xWsmk6yJXFbrNykM T3D8SURUeiGICpNU/6vhC88Hj61iyTLV3n0EIjJ0PC6lE1eSmaues6La2UpxDn63U0 lR4XQ8PqsoS9bvzz9cuwuclvqTaqcauDpkwzf2mY= 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.10 115/530] crypto: sun8i-ss - fix result memory leak on error path Date: Wed, 12 May 2021 16:43:45 +0200 Message-Id: <20210512144823.583079148@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c index b6ab2054f217..541bcd814384 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c @@ -437,8 +437,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; } -- 2.30.2