Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3707093pxb; Mon, 24 Jan 2022 15:57:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwI+xOXMGbq+qqPY92gtJtbLHHa7gKXlaDZyflmo+1bz8EOPHqiWqNoTay3tc106n2p0r6l X-Received: by 2002:a17:90b:1b0b:: with SMTP id nu11mr740814pjb.246.1643068639028; Mon, 24 Jan 2022 15:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068639; cv=none; d=google.com; s=arc-20160816; b=tstQIDmsWmAsTO5lFVIzx/MqxqppNjjzJCL1zpLxf+8rD+Mz1BAhTvBJSZFk39av9v SSNn3frbBvl18mRkfMReYBAxy+0Ae4RAgSl4Bg/uKtAtL+zAyZHrAcqPXELf97StzAUa 4/jtje9xKk6V1V4SKa372k3Y0eyMgBYNCaCtFgJFd5wAACSVcGqLGCwZ52UyHwXx7XJ6 civ0xUD1H/aVaZkSnlKj0jvyklVB6mLpDv3iakHWOIjJ3NXPTQIeKPAHTGAtnrhqvWmd rYt6SiYC539ZjFnXcq2FaS/yUoNuIlqYEpx5OZV6hGd7jzFUvfbt+1yk7AC1PzUMjGtG 90DA== 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=xClhCx2B91z5i7C3yaYHrQbfW9DyXwmCObGIlbIJfvfCy6JvjG3M7wrMhuhsidk7lt Qm/Q9hArGUGpcg3VOnQ6Wd6bVAKVQ5qEhEPKnEPfTl0A9ZyYOMznl+YmuneZER02SXUt E5AwOBVZBN3A/6OC92yxRFIHZxuDqfbquejEucd+ewv4k/eAIeG596e4wcvmJnF9qaG0 XJyk+qeT6aM5PRT00eigztN++U2TpeGaf/wZithL3P9wiJ8uqTm+qs8vnfi9VaJAfb9k FTxIOfG4C51sWl2Qsgv0NZdW9kol1bl58jiFvfGDiUXgez7/51wCyarUJw7SEHSKGszG msiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wKxCYiu/"; 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 i17si5716015plr.48.2022.01.24.15.57.07; Mon, 24 Jan 2022 15:57:19 -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="wKxCYiu/"; 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 S2363081AbiAXXnd (ORCPT + 99 others); Mon, 24 Jan 2022 18:43:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1843459AbiAXXEC (ORCPT ); Mon, 24 Jan 2022 18:04:02 -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 8783FC06C5A6; Mon, 24 Jan 2022 13:14:43 -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 46146B8121C; Mon, 24 Jan 2022 21:14:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BE0CC340E5; Mon, 24 Jan 2022 21:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058881; bh=zspjBTPA65ubtgbkRw3QgH1nHju9jZUDsFEcbrEiT9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wKxCYiu/sW1KCV/IabqVm12byNDu2BqnH9DlSe3FMJ7Udxlo3SDIJO9Izmj1fKdhQ z6E4kTj+IhDSUjYo3Huz4Lt7PuVFQ4XYacHuqL2QSdQEeMTs37XZW3Av1yg4TtDcNL UJ+KEUDEz/5R8Q1AwIYYwVt5pP0Gy8C9C5dZf2Bc= 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.16 0432/1039] tpm_tis: Fix an error handling path in tpm_tis_core_init() Date: Mon, 24 Jan 2022 19:37:01 +0100 Message-Id: <20220124184139.814606762@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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