From patchwork Wed May 12 14:43:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 435589 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp4994421jao; Wed, 12 May 2021 09:38:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJxA8pc2hVKUtRKsZgTNxZRpcpjxDiljqAJGj7NIRuJMJo+U7Z1LktgrsnikBbMlRHMZT0 X-Received: by 2002:a05:6e02:1d18:: with SMTP id i24mr11467451ila.157.1620837480842; Wed, 12 May 2021 09:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837480; cv=none; d=google.com; s=arc-20160816; b=RoTTg0UMIW004+hM/i+Vi7l01NffBuJ9J1TBU+eQcHU6cfpx8HW5U7ydwcDQ2vWyuQ Wj7juQ2SDow1D3Q5gHHUIIEHRkAfrIo34ckFx2nOD2EZvz4zN3r44PWG0t91QwWNLaj2 PJHNrHIVutuKY2v5xJRl56mrWqyjOeablIYd9PImhi7n/yKPJ4eCH1ibD9boIuCyMmuG p0d1dvv1Fxt1iXpp5PvH7PlcshCR8qar32S0GgvlhfK4q3+hcu5LFSWhyhMcFxNiLZh3 +LAY0jUtw09b4r4g6Wlni/mqY7nvY4w2EJyKMWFv9OdDjtTRJsl6x3OopM+IWumiyZPH 5efA== 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=m5+aC9mX3loMaJAFusaofEsPBwg7Hl0emKTBwOh4RLhhXIceJC5dg5KGfJqY59F4Rv /kJmbVowUWCzlcqnFWOqBdYcKfKBZJnSeqCtZxxHO0yzQD2hTRM8Fxnj4okxT+RKefPp 64dn4cEpYn0EuqobdYbpcT8/GGSLaLuZsfkVl9OL5bQ+m2hxPjfeUtlAo34bvlvJFo6L ipybdwqpgKFFnlfp/7426SK80OBDFaOg58CGJBfYM8DwLQYIRBQtNdo4gG6FDuk/t4nk Nk32zR4w/yuzhtGMjErVUdfm8WqNlNDO6xSSDPL4xZF3leOsANDjipEcdz8oGBdmSaa7 WD/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=voUS8Sww; 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.09.37.58; Wed, 12 May 2021 09:38:00 -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=voUS8Sww; 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 S235982AbhELQBz (ORCPT + 12 others); Wed, 12 May 2021 12:01:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:36062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238050AbhELP5M (ORCPT ); Wed, 12 May 2021 11:57:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B2DE61C2C; Wed, 12 May 2021 15:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833381; bh=kqBPCLw3fTjQTbbrkRgQ1iSU7cna6dND4Gyu3RXdw9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=voUS8SwwnqWs75bdi/4/gHSz1I0cvGQDtMWWqkrtvgkTnxpNNbpMVyB6paFEZ8BZE FQKzEiK+K8/6Fc84GGpsFkTVoG/o83vrGI6sMuwYlj2akCZ8xEPeXGp0xiz7l6GZoC JLklUdHcbvvNvPfGssytH5u/criYW+XjzaT6CWJU= 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.11 127/601] crypto: sun8i-ss - fix result memory leak on error path Date: Wed, 12 May 2021 16:43:24 +0200 Message-Id: <20210512144832.010356293@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144827.811958675@linuxfoundation.org> References: <20210512144827.811958675@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; }