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: 12113769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F565C433E0 for ; Wed, 3 Mar 2021 16:15:42 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53E6E64F1D for ; Wed, 3 Mar 2021 16:15:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53E6E64F1D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1NPWXTbxEiyLSdQT8ESNzu4G+7HcTjnulq1qNb6yTTQ=; b=Jh9xtN4FfdvxCTi8TxJnST27Y7 zQVwmYsx4gJ2QFJSrzM3XIkVFqHpBdFvAcWU7NhftjoIm4jUUf4C4RXocsBda8UubINQ4IB4vqZRO 4P2+9N8QZRS/A4xiBg3EVKgsM3pt6SWw8lo4U3l6t0ESsSn5jCLu0SHB9gTM4pBbaB/GiOrIaFynL 59Etkm/7J0cHUC/c1aDmeBRNHiQjnAxWAiOBlLbgrp2M5PMkJA7+dpU0wWTVPdyppLJgEMfkptXF5 18uOBUAaSnyVDv1IF+JYWmoNOXnHVGDCHFCeaz2vC1ctbBBjNN8u35YmmGIXEYExazWKHrQuBrF1u Z6NXKRhw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHU7v-005YTf-Kl; Wed, 03 Mar 2021 16:13:32 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHSp4-005Dns-JY for linux-arm-kernel@desiato.infradead.org; Wed, 03 Mar 2021 14:49:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=9W0viwdJntP7gI+dWPYfiMlk5bPjrilUkTfpNlZbWxk=; b=tVrsF40zUs8BeAZhjXcjMTD5e7 oO6OJ37HK+HX7wGeLlxSDTaThnIcXejmEGM8zW4PU5/U4yzukoyxwyOXME07BhKFQBrqK0ZjqKtq/ cIvrGFUdbojaHD+c9Woi/3mYNbfuNFeIy792VbqZHF0Eokemt1DeCX1iqkjIWSwOZ7vPjfSiq8yi3 rBwTqdjMr2NIE0v3vNo6VB8UThytRRr6brp3oWjvykX6niIdeoP6+H4PKFBEVcZKQrvVysrw0aACA ABmnVhT69vrEZsJGwE++3tSLyvdK5FLamLR6f93uKCsTq0H3mD97yfrHgdgfkEQU0+nL9gvrZxGyf 3hXPuqow==; Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lH86i-00HTEW-KM for linux-arm-kernel@lists.infradead.org; Tue, 02 Mar 2021 16:42:49 +0000 Received: by mail-wr1-x42e.google.com with SMTP id w11so20554616wrr.10 for ; Tue, 02 Mar 2021 08:42:48 -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=lqBBBpSkBixuOoJBotTDOAPCKnP7FJYzwPRRLAFBKGrXChRIVK2eu7x6O0bfnBQ1fq 4DoclYiYfbwzcuC3rfmCTinhoYl0obpqim20kO4sVRM1Lx3XVJXpVcaQ5m8ROFtNKPkc Dm8mHsT602et6uGrA13OAzFEqHfYARfSG10kP93yaG1MS2YHTvks6SozWZAgb0AfUu6n CKPKFnvJU+UZLnFnxrND03RFM0FYP1RIX95MuoBpTrYrSuUy2/zGmEhowWSf77CP0aQB ZJWAnnt4qCuQ7fV+LwxV9eBktNwQn2wKpiuF+xq8yDHo4xrCkSrot+3aAy4fd5tNt+JZ /6zg== X-Gm-Message-State: AOAM532He2d8PviMb+9znMTlJlg7xzIIvxphUo1dHqhIsglRFeLoSvUO 1uXOTqATQes1inYHVBs8SGI= X-Google-Smtp-Source: ABdhPJzFgCmzI+zTktaikKxMVsMvOJYAhlkzEjqVS88TYQIfiVVm/Y58QJ+dnOI/yP8XToMLqTzkkg== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210302_164249_268980_7D738E88 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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(-) 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; }