Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1899645lql; Wed, 13 Mar 2024 11:13:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1t1gLOsXrScEVym6LuHnsNdqIoWyvSC/pah6jtrVS0eGSt9j9i8Oc2E7von5QbrxZArqpzhrx2HW6bNIVwnhMfF7Z9nvFJuh+4JQkJA== X-Google-Smtp-Source: AGHT+IFaOKSVXdWlr10J1uaj0xZ7y2brmwuHQK+nXElmud6AL0wjdRBQcH8FGYB8xaTO8Wi+hzEy X-Received: by 2002:a2e:86d5:0:b0:2d4:6e24:3ca8 with SMTP id n21-20020a2e86d5000000b002d46e243ca8mr1406676ljj.46.1710353590436; Wed, 13 Mar 2024 11:13:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710353590; cv=pass; d=google.com; s=arc-20160816; b=rqFN9SFUVcieb8dy1aQTV5EhAIyEi3+ZVQmHZqMXzGWd7x0Q7WFt7WNFouSzqAhaHm o0826bPayKGVHpG4S72MXJfiDG8T85oJhwJ7+ar8fEcTCCeAZlxBQNSZERxyQs0EEOy/ 1T7NNmYwJnSmOyUk0/+VjIuqgw7tjkMkkxnGMgx6elNR6f7N7/O1JZUm6upmKgNvjZ+K siREbFJ2tewz2QqJtSS1htzIQC36RIco3hAwkTEGHPIw5F3gCrpnwNXU1iutEPR5pB8Q XcsLUXKIoRFwbNyKv55r4zM7o0Sq6FovHUqUvb85pvBJZHHggJCpVieIXh7i6mxIfVDG fZaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PjqbdICESVnEYuSE7mK0G1ljrSKmI1V0CfFRXQ08un0=; fh=m0rtVuFa4a5sbLcBGBVg6XLiCwGdQR8PIJukEOOdM7g=; b=hBcLzKih0i/CvPkoNU4rFFqn9U8uFRBIFQpC77lvo5QLeApW4k6p/Bm04Fk5ozEvJ6 BQ/EMThjaVmvQTWAwqUOayHjFLBcIlwxfkXy6xBTxLmnUlB7moNDIV5r2Iz+LCxKmIHt XRGSYfXvq3ulzXFCPlmbSJ2AXIU8Xe80h89SIApv0MAT5Y4IBBsEeQGe4ZtD54BvTz4j HRM3CKDTgpoKEja3kIG6/uiNOhMhb8lxMCDLQAKt5RT4E/MQFl809eNRt5+FRp+i1YWS iX9ztvemD6oOtRYDWZcK8OLUnndoqyL7Ts+c5d8PpcQb1XmMARxIcKXXuiVTp7lzFvtd KsgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DgwFB9ta; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102092-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y18-20020a056402441200b00568235f7d82si4935236eda.313.2024.03.13.11.13.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 11:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102092-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DgwFB9ta; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102092-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4EEC21F2D744 for ; Wed, 13 Mar 2024 17:55:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9ECE18CEA2; Wed, 13 Mar 2024 16:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DgwFB9ta" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C589A18CE88; Wed, 13 Mar 2024 16:47:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348476; cv=none; b=nhfQgvedj04YMCRqWAsLvSRhflx576g05jIYZsvPGmF3xa3qe4Z0vwBmsaGIIL+Uv7wFctWLBMDvzegilNMWE/tlqL5pDW8eJUmQitkEvooLJNnNO5g/PgfmZWrsTXYfHv0/SGq5TGB4K2SRMHbUYVcawKHL+DKwrUQn0x47yN0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348476; c=relaxed/simple; bh=AwSfW00Oqx1S8JYMbz0iz8+zYd9ifGgR8q1OwaY3Cls=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CZDDeAEKakrGhY++ChLja+dpOLOYBgvkSCZe9Tnl76htq8t1lGJ9UGYByotW1eExugBOt84WU93MSZpAHgTS5nTfVmj1gHwAsVyGHotbXlPvZh/sb3xAB6orE9i6GRg/7yxhSeKKk12D8CP9Vl7Kx/zz1JdJr61jKcNW1nQkIjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DgwFB9ta; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7524C43399; Wed, 13 Mar 2024 16:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348476; bh=AwSfW00Oqx1S8JYMbz0iz8+zYd9ifGgR8q1OwaY3Cls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgwFB9tamHTJ+uJE7KVFyTfnoKR52mhVZYldsYgTRlzq/OeYNtDfeSOS14IS14/YA brXueKtAApPJSyhuipGfcapgqLZXYPCScPTKtLreMHrnD/s2MxhyXUZX8V7OFFdEXI dM383uYYBClCZydgBPSJce6I1ltPrXvJ+nGoZYyK/5pxWVkhO44b+DwKtsjMRTJtI1 h3IP8H993omHy2fOcNJsX9AEbiIprgoml5WYGtkZ6F9wtjvURNI37jVzeutfzfzlf6 EzdUdSZG34mYQdUApgKMpM31RKbTTsNPMPDsVtuWeBRCWEo75ko3oI2o2YWScf0WyM MiR2tsT4Ssm+Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andy Shevchenko , Dan Carpenter , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 5.10 66/73] serial: max310x: Unprepare and disable clock in error path Date: Wed, 13 Mar 2024 12:46:33 -0400 Message-ID: <20240313164640.616049-67-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164640.616049-1-sashal@kernel.org> References: <20240313164640.616049-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.213-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.213-rc1 X-KernelTest-Deadline: 2024-03-15T16:46+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Andy Shevchenko [ Upstream commit 61acabaae5ba58b3c32e6e90d24c2c0827fd27a8 ] In one error case the clock may be left prepared and enabled. Unprepare and disable clock in that case to balance state of the hardware. Fixes: d4d6f03c4fb3 ("serial: max310x: Try to get crystal clock rate from property") Reported-by: Dan Carpenter Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210625153733.12911-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/max310x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 978d9d93127e5..a09ec46e0310d 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1293,7 +1293,8 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty freq = uartclk; if (freq == 0) { dev_err(dev, "Cannot get clock rate\n"); - return -EINVAL; + ret = -EINVAL; + goto out_clk; } if (xtal) { -- 2.43.0