From patchwork Fri Feb 12 08:46:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 381793 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2761186jah; Fri, 12 Feb 2021 00:46:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaXR/1ODPB+C5VjI9ENp0TnhN9xfzNRjwutJ0bHdJJDmCjAtIw6vfMqKrOQKFoyYwn3lTO X-Received: by 2002:a05:6402:27d1:: with SMTP id c17mr2222992ede.109.1613119617633; Fri, 12 Feb 2021 00:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613119617; cv=none; d=google.com; s=arc-20160816; b=ZaZ4BOAfvxniYFrJzcm/fB0KozAO/mkOhyunKXj0Hsc9Fp6SZXpc7xwJ3qVBAm4s5D uAa/SklpWRyTZqr+ihindKrumeogu0mIZffKmgHCxsSaFERXUw94xgE1Nh3ShiKHM7Dy 95ALWmWC+H+x9mpUDbVm1M3M50ZqSoDDbaKYnkWQoZsZa0gy54MCRD59HjGDUymrPCli 9W0ZshbS5p9HXA9IxdgN46gFjo2pkPKuzg3CWLmMZlplAi3m6RrGqXDwe+QWjRlicx3d wf22L7si3cGmmmurbXw7SZzhQaSh9ImfxM23NiY4b6LSL2F8OYQtiB244cvCg6yMi4Ay eDiA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=9W0viwdJntP7gI+dWPYfiMlk5bPjrilUkTfpNlZbWxk=; b=X6FNExwHIdvA9JdyaPmP9ZAzE8wWXPZRCjLEZz2wVIHTstc5NvwlevTwp5gVs/ZdzZ iaj2b/2FzbCyFt9HylSjwhAKvafRWbtRW841whN9xdskZRV4a35FrDGPzyufUuMaFn7I wSmO/JcDrrXHyqIDnmj0/R/HdZzzG1MFn63yOwN3NsxoawxCVKBWse7ydyoo/Ed6LIKB Ke6qnR5Sqesh1ktLPwt6XIR3oM12pOJlrVFFAMY+0F2ibluxchG7a0CjDtkgP0CqWUnh Z6hK2bA36XOLeiiNHYzA78IdAiy0xbyIDKOLLcQSPXWV0VcGrHb5b0NSeglF8vJ4HU+5 785Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="gDOwGzS/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk8si5750434edb.76.2021.02.12.00.46.57; Fri, 12 Feb 2021 00:46:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=@gmail.com header.s=20161025 header.b="gDOwGzS/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbhBLIq4 (ORCPT + 2 others); Fri, 12 Feb 2021 03:46:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbhBLIqz (ORCPT ); Fri, 12 Feb 2021 03:46:55 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC188C061574; Fri, 12 Feb 2021 00:46:14 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id o24so193153wmh.5; Fri, 12 Feb 2021 00:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9W0viwdJntP7gI+dWPYfiMlk5bPjrilUkTfpNlZbWxk=; b=gDOwGzS//QQJgRI7onTiuqDZ2keD2N0xTf5WETdLTC4niVcPBQ/y4qJfImZxtt7VfD BHIRE9jJd7uEB25PsY+IerSaRj57+4WCVpI6MI5fgxhaAJvjRp6NXlrJW0TeRxz2kIr1 vpw5nBw/lChSH0zzq/3yoeYHJGtik4UpwZgR1aCtEOmtHP3qWq/KitaBt7dKyxzKRkgV U9D77Rcv4rEr1qS6m0uryq+0WO5M0Xw3D8GmyJJpOB92l64AP1NWFndFDk5lv5QGDQnO wN230x38G3ZxE4j2Wey71OqksHpHo9Uvt1UnYfor2F8KDPjGy5u3UyLIYM1LkIc94teE F1+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9W0viwdJntP7gI+dWPYfiMlk5bPjrilUkTfpNlZbWxk=; b=JsdRviqMrDqNre28KRqN98/u+ICgObF29WLAQnVZINJs/ur4TcRLvb+qzrLyoOxg8I aKQJ5dGXR5OAlLOTwpCtJ4BkczKJT0KYFErJBx8aF9gOrsra/3JGgXM0kZZLeOHbTYwH PLgs8w0DUtQ7NDL6+48d9P93TQah0bS6l8Z3Ru97MQoY3S14O636FcXHOXZQmDm/CO8/ x1n39ehp4KYGzM3Sh6V44Lk4BhXfz78lY5BrJKmhXCb9/qC8LqeJhx6MNXXo66d6zSKT WEdCYvVYKWQIfEhGxqy+Oc4JO+9I7GxOQaB5jAb7NBnYnKXz/O4dJvOVQaRF1sA7R8Pf OHcw== X-Gm-Message-State: AOAM5338WJuN+SMZm5jTvOr94kmhqa5+FNS29h2RgobIcebolj/S1+OF dwNSDxcuxxfuwuFsTJPtyF0= X-Received: by 2002:a1c:2905:: with SMTP id p5mr1639409wmp.156.1613119573516; Fri, 12 Feb 2021 00:46:13 -0800 (PST) Received: from Red.localdomain ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id j17sm12895530wmc.28.2021.02.12.00.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 00:46:13 -0800 (PST) From: Corentin Labbe To: dan.carpenter@oracle.com, davem@davemloft.net, herbert@gondor.apana.org.au, jernej.skrabec@siol.net, lkp@intel.com, mripard@kernel.org, wens@csie.org Cc: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH] crypto: sun8i-ss: fix result memory leak on error path Date: Fri, 12 Feb 2021 09:46:10 +0100 Message-Id: <20210212084610.32185-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.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; }