From patchwork Wed May 12 14:43:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435557 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4927948jao; Wed, 12 May 2021 08:21:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk9fWNrQdoXSRVu3S5MfUSu/Mrdd9xUColli+aaXtbKsBvcwEPULTk3W9qrbAV11u03XaX X-Received: by 2002:a05:6512:3e12:: with SMTP id i18mr15765846lfv.154.1620832905409; Wed, 12 May 2021 08:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620832905; cv=none; d=google.com; s=arc-20160816; b=FBZ88YTQOjG15g0KRsSsaBqdl64ICtx12XSNRuU/t+Q34ifnuNXlggMSg/rEhHxXlg V4RRkt87oTACltKRGB8uCaHvffTwl5cLKAJjzXuVMdui+xZrdr01TFmofrKXOPLVRREV cbj0Dbf/wwUmJtEI2rQhqJfJlFVAie+YLA31of8J8Jar5YdZmQXx+b+iLSGTKJ84eeif 9i4gGNHTnuk/BUd+dxR/insHjpfI2olHFD9raqpfOg4YhOXJLbhOhRA6E/du5lDWeeqF CpMkhMNYrh3E9h4Vmvuoj9WUYbAuksjwABZxjuuibpAepZMyXin1HsMmnPtOnlX7ILHM PT1A== 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=DH0RoCS4m9r5QouRUrc9j0o86z18n6fxtyISFiDL4Glphc10v72lEkAjZJYWqRqojn Pp/g2gNVksO0gcoUR7hFak4iScZJxuIYPaUv/GOrpQDhzE/4xVWFpDP8NkSrQX0fvbtG NVlnPyxXWw8tl6PzlfPloZMoZHxBmDWAQyxigZ8J8awqRcdCiHUa6DeDAlvsH2bPRiYZ t8XfnAovmYO8H23PtYJIk51F6flom3Odp9d1gt9TU+i4ImBh1QqKzoDuJlZ7Ch4Y/hfb /6RuJ7m0QFW5X8XcRM2AsyY8u2mX6FQy71Hg+EnIKGzW6D3eMVsVy0tgI4aPOXqBd9sw GTkg== 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 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 m20si100438lji.284.2021.05.12.08.21.45; Wed, 12 May 2021 08:21:45 -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="Qs712h8/"; 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 S233430AbhELPUx (ORCPT + 12 others); Wed, 12 May 2021 11:20:53 -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 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 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; }