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: 12084939 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 22E8DC433DB for ; Fri, 12 Feb 2021 08:47:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 B9BED64D73 for ; Fri, 12 Feb 2021 08:47:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9BED64D73 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=NCX4wW6pIr372lhUpOezvN9iiz J47SqftN02J+NTul4KI4FpAq9nB1m72R1vpPCBTXfzRNc9ET0DVOJRDX4Ja1qlFfggLIQcTk/qBpR 643Hr539o0bvwsAWaFw1GfBmPAH9XFb1/CR6allSH8bASYh+Kg2j9T87F9RJN4s35fHj06NvlIv1Y 4VByklLSn6NmRUZeFXQDw38TScot2kBuZtwTCkFrNlQ/NjqXse7NuysCSaRP5Y4S3XpNwOcgjjgJF uVDf2espWGzXcjnrctCtMDiAaAMo8dBReTXkOgsfdaLiiAGXRSGgngp/tkTOlZjcw2SYynzgywWvy SrR9NKww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAU5j-0005VQ-Hy; Fri, 12 Feb 2021 08:46:19 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAU5g-0005Uc-F8 for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2021 08:46:17 +0000 Received: by mail-wm1-x32b.google.com with SMTP id u16so198651wmq.1 for ; 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=AkxdchB0h7G6ZKLzpxhHzv3fTPwTouJNcWlzGG2rrr10xVCl6Fk5iZCdIFF9vn6bU5 nd70914dAqfRxLNF86HWdjhxDVmDmDst0HQ5kMsO5+fKGZ9fRxI5yu3czabURiwRBA7T qMlKxThqYL/eyXSI18Wd1/L7I1aRioTafPspnz9ERnLERX6r5VIbRaj0up4r+1NB76xP e3Z372TKHfBE9lVLOFhAX75L6pJTqz9mUJqJP0oowasHsK1U0D9PmysqjW8YSCDkNs0h 68Etcvttxedxcg7BL+8Zeb9dTGm+YRIT2/pYOqcNDSknQXAA82c/ks7P/pC5SiEbICQ5 mXug== X-Gm-Message-State: AOAM530lV7cyol+J+2oMN1grf1hpnxBXlyt0+TnpG3P06m6Ur9q1AyFF eEBCrQ1ZofATsJ/jt9p9OLs= X-Google-Smtp-Source: ABdhPJyZJ/a5SmKJ8hCB2zTiNZ74x4e3yd/e+MIQVJgA8wy1CfdzxlCjp8o+jiyH8VB1DdClpjgubw== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210212_034616_537045_56E9A60D X-CRM114-Status: GOOD ( 13.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-sunxi@googlegroups.com, Corentin Labbe , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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; }