Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3661599pxb; Mon, 24 Jan 2022 14:44:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzF7wN6wDcq2tcZ7XhhHXDPc3RIh2ysV4ls+ydGlONppafxdeGMks0bo1nGT5zlpZwcGxsV X-Received: by 2002:aa7:888e:0:b0:4c4:3ad:9eee with SMTP id z14-20020aa7888e000000b004c403ad9eeemr15649919pfe.13.1643064169751; Mon, 24 Jan 2022 14:42:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064169; cv=none; d=google.com; s=arc-20160816; b=vONa1ZVqb7laNYL8U6Fq7u3wcY/yykVQxP7/DHpXGdA06dfqG9K33rOfYPh8MVgnEB YIR7dx9eDevLSXkpoIlxasGdYPNlboUjhlKACgArRqRedvOjj9H9HHldWo0M9BxGCO6/ 6finqgHgRqp9UcpUyQfU+En9kZ/M/PPLtqm5tu+SLqEzY08iYEBEVO1Ayvv7zfWQK42Y Tv3/PzERSw9H2ftIydOLb1kr5NnzNcxxmmy/5nA0+8kjzh00qHsvUxWNmAw+0zuRof4n hUgCpLZmiMwKTkaNhd7LY4ZxSB6uCXXufOeVMngxkTXTHLd+T9eAm5/7sPAosW+vALeN 8rag== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kWttAvMZ9CelZUJakJHufhVZR7shUngOk9EX6yIDCko=; b=tSqQwjDz5WTZfvP30VEWDCi28JfxFK5QeCm2Q+SNAcw5jSmBNCPvSe2Ql9GR1RpdJ4 DTiG8FTDGS+LlJJs421yGOj9Cr1P9FlNWSWsR+WEuMtMYFYOb6M9JJf8PjIvIOZnFERg sicdwDoorIy1ptGu/1rI+NJCdvulFhJpl6GPBVkxU+ZDwuTgHmYO3KyIO1YsNvWiQanW 0ePhpgoZiaSqvyyb/JPof39qwId0oEWOPoYPQFXIMpAsZwEmTqmkMJTLOTfCQH8yArjU 63AwqRKb699IeyM+bysWsEA2WFFDdFhkkwnWpk7gg2FCuCModAVYuQTILXOUpnOqP9YL DK6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FzDOeoUI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si15413744pga.590.2022.01.24.14.42.37; Mon, 24 Jan 2022 14:42:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=FzDOeoUI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382767AbiAXWjr (ORCPT + 99 others); Mon, 24 Jan 2022 17:39:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457320AbiAXVl3 (ORCPT ); Mon, 24 Jan 2022 16:41:29 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80D65C07A944; Mon, 24 Jan 2022 12:27:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3E1DCB81255; Mon, 24 Jan 2022 20:27:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68B13C340E5; Mon, 24 Jan 2022 20:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056070; bh=zspjBTPA65ubtgbkRw3QgH1nHju9jZUDsFEcbrEiT9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzDOeoUIlQiDGjimS0n4gjBaeSYZdhrGIdbx3dBcNYmI3GLnrkJ8dIVOMS4v0n/6k SgQVuDGWsCKmOiiqkCWGU3boQI173fTJly+CWyjmaIYXvrC9Z1cx3JT3op1ZU/naDw RC5gKNjBO4DEC4LHi9iTjt5hfREJj+GAyux82lr0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Jaillet , Jarkko Sakkinen , Sasha Levin Subject: [PATCH 5.15 359/846] tpm_tis: Fix an error handling path in tpm_tis_core_init() Date: Mon, 24 Jan 2022 19:37:56 +0100 Message-Id: <20220124184113.310952890@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Jaillet [ Upstream commit e96d52822f5ac0a25de78f95cd23421bcbc93584 ] Commit 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries") has moved some code around without updating the error handling path. This is now pointless to 'goto out_err' when neither 'clk_enable()' nor 'ioremap()' have been called yet. Make a direct return instead to avoid undoing things that have not been done. Fixes: 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries") Signed-off-by: Christophe Jaillet Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Sasha Levin --- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index e2df1098a812f..36d1ad8f479d7 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -952,7 +952,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor); if (rc < 0) - goto out_err; + return rc; priv->manufacturer_id = vendor; -- 2.34.1