From patchwork Fri Oct 28 06:43:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 12121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp660096wru; Thu, 27 Oct 2022 23:47:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pFDI1u+9yPnOsxUWfRsYfqkblFkHpNLaYcqEJPczQtkwAyRrovCJyIecm03T5V6Oul70B X-Received: by 2002:a17:907:3e02:b0:782:1267:f2c8 with SMTP id hp2-20020a1709073e0200b007821267f2c8mr45629775ejc.585.1666939679524; Thu, 27 Oct 2022 23:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666939679; cv=none; d=google.com; s=arc-20160816; b=J4X1oeX+z5asAKMH6WV0j3Bs0Orxgs53YsLtjsRXRc+WcFdBBAS7jzjFmVSyJmwuL1 A/bNBsNzmA1vGu46pRYkWhCIHo5zRrsQKMlsBhCw26zCB7hdJ0rpqpU1l+u0gS6lZC1d nOuijzzS2oF7QUuTtqvU9vvILIa62R2Z6HvXxRgnTSVq1xvDg7Wm1lNTdQuK6owZOpvl 7MGbgN9XkAvfb4KFgIkc0GOpPFmtZzUIEYN1tepI3irG+9JTrtULmruW2ZnZKyvEZBjW ig8k5QOsp4jAEDUYUICAYEBTSCiMNExQAAruyGGXfoaP5tC96WGzeXZ8eZP4xLtabwOy 4IGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=/AwNFqOWTlu3ckteTP0xnDuHtpt1peKf1P8IqbpEvhA=; b=HwDdphLvHSUR6Z3/qyLpUlmfeVST2xZU1TjF3BOk/SYMto//Qh60KYgF+JBAj1Wggf vpEeWn89fcechgMdl7yCjyPfOzsoGB/JP5WLB+SRsCbySBMApjVi4bYf8ZYJ0okZz5KJ Udl0ph4QGNjzKUlVEJ4uO8YMi8c0YFvRzKWjVQs7p80XvKG7lshIFVIfUcTA9ktXI9uf /4UfabcbJZ78csFohcIXw2Mm3jPo3+4KdDJCJStkA4jNaPLjj1i/sg3XDWSvoIbd2EAd cG17WSUXtuuXMTGTe98L74xNZE9GkNO6SQMyxZfNWorUcw9kStmyyH25D/NwTPID7ej2 9dng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LVmjIJk6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a17090658d300b0078b0865d468si4211738ejs.549.2022.10.27.23.47.35; Thu, 27 Oct 2022 23:47:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LVmjIJk6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbiJ1GrB (ORCPT + 99 others); Fri, 28 Oct 2022 02:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiJ1GqY (ORCPT ); Fri, 28 Oct 2022 02:46:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57BC21BE932; Thu, 27 Oct 2022 23:43:14 -0700 (PDT) Date: Fri, 28 Oct 2022 06:43:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666939389; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/AwNFqOWTlu3ckteTP0xnDuHtpt1peKf1P8IqbpEvhA=; b=LVmjIJk69zkJDINXCqRe04IiDcmRR+CVI++soorbt7Qpi+ZDnWORdM+jNXhrzPIoi5Opxe vrvO2pjrCV6kiyLNw7xHuoPk8V8wS5C5eXFZeo18LrHOJ6xacUmAuuQ0qentcS/3OLgU/G PKlt5RAP2w7aVbSiVG/jrFXhI0qyoOD35Qc/tXbp9Ql/srHcblGi2EfWpqHbu1IZAoYhrc jnCJSS878I92JYy66+2QO2rdVxsPmTP/JmmrHV1M57iIiS4MbIXLgYB427Cy0Qq8Yv/a5G XLloNSzBAWlPGGKXU0SyoBKBBMMk2nIYK0YmqnydU9Sg2xFR1gWNXnl+DmexRg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666939389; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/AwNFqOWTlu3ckteTP0xnDuHtpt1peKf1P8IqbpEvhA=; b=QJmvcukZvE83K7C4w+8fXiJI3LqunT8Kwr6TNd+8eP28znf/xgeB7U8pia0CiWcPSZeZdA OjxF0b4uxAgfGuDg== From: "tip-bot2 for Rafael Mendonca" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] virt/sev-guest: Remove unnecessary free in init_crypto() Cc: Rafael Mendonca , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221018015425.887891-1-rafaelmendsr@gmail.com> References: <20221018015425.887891-1-rafaelmendsr@gmail.com> MIME-Version: 1.0 Message-ID: <166693938775.29415.2368858785626989918.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747912941598924655?= X-GMAIL-MSGID: =?utf-8?q?1747912941598924655?= The following commit has been merged into the x86/sev branch of tip: Commit-ID: c6fbb759d68898aad40e57d09ed18df6094a1874 Gitweb: https://git.kernel.org/tip/c6fbb759d68898aad40e57d09ed18df6094a1874 Author: Rafael Mendonca AuthorDate: Mon, 17 Oct 2022 22:54:25 -03:00 Committer: Borislav Petkov CommitterDate: Thu, 27 Oct 2022 14:24:18 +02:00 virt/sev-guest: Remove unnecessary free in init_crypto() If the memory allocation for the auth tag fails, then there is no need to free it. Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver") Signed-off-by: Rafael Mendonca Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20221018015425.887891-1-rafaelmendsr@gmail.com --- drivers/virt/coco/sev-guest/sev-guest.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c index f422f9c..e9704ae 100644 --- a/drivers/virt/coco/sev-guest/sev-guest.c +++ b/drivers/virt/coco/sev-guest/sev-guest.c @@ -152,12 +152,10 @@ static struct snp_guest_crypto *init_crypto(struct snp_guest_dev *snp_dev, u8 *k crypto->a_len = crypto_aead_authsize(crypto->tfm); crypto->authtag = kmalloc(crypto->a_len, GFP_KERNEL_ACCOUNT); if (!crypto->authtag) - goto e_free_auth; + goto e_free_iv; return crypto; -e_free_auth: - kfree(crypto->authtag); e_free_iv: kfree(crypto->iv); e_free_crypto: