From patchwork Tue Mar 2 16:41:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 392622 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp5595626jap; Wed, 3 Mar 2021 17:25:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKRoOyiwEBkBFA3mRD0m0IQMZSFdUsWySMHIO8a2CV/y/oKMIpux+N8l5iFjDa78wqJjdW X-Received: by 2002:a17:906:3052:: with SMTP id d18mr1585099ejd.530.1614821136460; Wed, 03 Mar 2021 17:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614821136; cv=none; d=google.com; s=arc-20160816; b=0BHy3EiQLCvk423ff+WPqeTEBhzIKNt+lXzSzG4GCXoPNdyc99ksl0HUqmZMIcXulP RxvI3VP6Z2U7N9H6O6PzavdaKlOFit1kxRUxjlX/3OkgbX7wuvTR59lUiP9WBpyfcgtQ uvTdPlsl1MCSaneyvfYgy53gQceLIAxWVCuAi+DB0tjaQ6KtRomaM8K7Y6SLF5ktSQ01 XpcGtzQlc6Y14gCtmGi6PDPLfHiuMBrKvYXzCASMc1vOYB/wqaqmkUsLrzROH4ZDbP35 FWjgeYBFOpaYjYQu8NdUB1Tpw5WXhegkpDJ/szXy64WOinrbKyVUe8/uTInJ1js7xJlM MoDA== 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=iLNmklfMN4oUu9RNG2HQ5nCK/DtRzurYwuAwMjVVrBrUu7XQpA1injMamDGzwuOQKz c9Uv/HERCDBwy+a7PwFJqGC4X0kLdTpnUMNHNfgWuhghOQS/GJSE1NunbBcWVifEx/hB zVhhqOnkf2UJl1IGhRSy6LDOzPPuNphzqHlILKxRAkKNo6cwpJ+Dz7TJdNGBGcSsga6X QOE57TU5QQ2Z9Fj2xJ095V6dodxRF8QrMCbSUrfNeMQiuhaWN4LGJwCqdF6ZhP8NV2Zi l6u13c4cO4PmETx2+iQ4qFW8H0pxcjcQJ0T+PiHDwf50sUodyEYqn/TTZEx0IVP8LxB5 gmbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PdEOlM28; 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 p17si16189393ejd.307.2021.03.03.17.25.36; Wed, 03 Mar 2021 17:25:36 -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=PdEOlM28; 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 S238472AbhCCBfs (ORCPT + 2 others); Tue, 2 Mar 2021 20:35:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1579862AbhCBRLM (ORCPT ); Tue, 2 Mar 2021 12:11:12 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C62C06178C; Tue, 2 Mar 2021 08:41:49 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id v15so20584174wrx.4; Tue, 02 Mar 2021 08:41:49 -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=PdEOlM28X5b1Ll7Y/aYJ3kGEIP1QsxP2nokFGItxFxk5oAYyPpzK8MbrqcuaUxwPw1 m0dseYB82Z8wNWZQz+qwppcx5LiYwAzOubGer9oYB7UCkP0AgAqBqBIgg11TJMyQlZTA gDZNcuxPNWerKUj1YqL3qcdfVTlSy9OZd1whqEhSF6gW4WEtoHbc9CuAKhS70KVY6yAa VCQS/xuVAtq3d63mr1MBDmURVyAkGhSbS9KK49fhUy1zPmKSSQkzJ7yPHY+wsNgPygi9 XylR9eHbh+KgWjfTIwzdFmeWx/SoIZCuKdcwyPqmXj9AGi4ycuOEI3Od6sEDGr8ISZnM ZPtw== 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=j8hNC07tTWfOzGM73eLFMubrJIX6BUk/WneT2RFs8Rinxyxb1IcLnxsZfJkLMqBE5t tx8UIp4KvnJSDpZ2+/Mp1DhcI7HbtkdLCYtS4PWK/rcuIIcO3xx3fVnBve49iIrIEuQz AFjeZsxBE+jTC0Z850X0LBTzvvR6+HVY3qm9chUdoJsdituT5MpC7yU3AMKkRjKMgBCx E93vdEm1bxMaUXb888LUdXiMDiMq+W959Ozu20xFcQ9LZPJBl7TjytEh5V/j1lSQu9Xo mFrgc2a+ZcQ3fHJfrnwhVilPuwATNcrff+yNjLpKLVXI5WZSnXKhoQ6EAbwT34lyjV/T 9qBQ== X-Gm-Message-State: AOAM5315QA20yCuzWUvhjUZHnLlDiq4krjNiPxTxq0xq2i/jsp/OTVNL pedrAPp1MTMaToYBipZO7ns= X-Received: by 2002:adf:e411:: with SMTP id g17mr8273916wrm.225.1614703308022; Tue, 02 Mar 2021 08:41:48 -0800 (PST) Received: from Red.localdomain ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id q15sm29227175wrr.58.2021.03.02.08.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 08:41:47 -0800 (PST) From: Corentin Labbe To: dan.carpenter@oracle.com, davem@davemloft.net, herbert@gondor.apana.org.au, jernej.skrabec@siol.net, 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 , kernel test robot Subject: [PATCH] crypto: sun8i-ss: fix result memory leak on error path Date: Tue, 2 Mar 2021 17:41:45 +0100 Message-Id: <20210302164145.28552-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; }