From patchwork Tue Jan 16 21:29:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 763259 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (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 77E2434CF3; Tue, 16 Jan 2024 21:30:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705440621; cv=none; b=IdZAkFHWpeA02kmyQGA2AQhSjkIF9qOgelPSOrzbw8PNwupsvP+mKCocqMqYRDXNdipF3KG+N8vVPnNaNh95fpZMlFkRTvPajdsVM2k+ijA+oA8H0seadMMsB339RZobnl14wPqe5UZfml+fkz0rDSYcfanyi22bWvagaPc7p3s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705440621; c=relaxed/simple; bh=9mBTImWWy3SGrRbzyE15IxTVRNYtD8T+YpnHzJ2/24s=; h=DKIM-Signature:Received:From:To:Cc:Date:Message-Id:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding: X-SA-Exim-Connect-IP:X-SA-Exim-Mail-From:X-Spam-Checker-Version: X-Spam-Level:X-Spam-Report:X-Spam-Status:Subject:X-SA-Exim-Version: X-SA-Exim-Scanned; b=fZqZfLm2W6EyAKd84iXCFpAvvlBjwx6VMZH2jBrGvHZEXDyJR6zpqw54x8quaegtOWozODLaOjZZxcN2dV1Bnb6NRxS5//2Si0H+UviECSPoylzrfozJ/lS+pBSmGtp7FBp7BINRL3OVtrdPBAy/1jG4SoJMTr6WDBk8XejJnxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=BAnTcFXe; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="BAnTcFXe" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=LO5AMJoi4lTGu7m9IP/Mq7nyuFtod3doZ0XW/a9gDtY=; b=BAnTcFXeeaFHwk54f77LfkYZmJ k4LXbCe4HPNJFQMZM+XdJNn/8RbVJt9kE+YlYPaRkS26/J2gDg/gxptBEZdMZiDbOHJv+STz+1EPj nbpNRnwx2mYKbaH2Tioi0rD8O3WY3YpQqeN3q08XXJvpIt2XvDhZaO8TOxnT1dHcpbHw=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:47418 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rPr0X-0002ia-Ky; Tue, 16 Jan 2024 16:30:06 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, jan.kundrat@cesnet.cz, shc_work@mail.ru Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, Hugo Villeneuve , stable@vger.kernel.org Date: Tue, 16 Jan 2024 16:29:58 -0500 Message-Id: <20240116213001.3691629-2-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240116213001.3691629-1-hugo@hugovil.com> References: <20240116213001.3691629-1-hugo@hugovil.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 T_SCC_BODY_TEXT_LINE No description available. Subject: [PATCH 1/4] serial: max310x: set default value when reading clock ready bit X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) From: Hugo Villeneuve If regmap_read() returns a non-zero value, the 'val' variable can be left uninitialized. Clear it before calling regmap_read() to make sure we properly detect the clock ready bit. Fixes: 4cf9a888fd3c ("serial: max310x: Check the clock readiness") Cc: Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/max310x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index f3a99daebdaa..b2c753ba9cbf 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -641,7 +641,7 @@ static u32 max310x_set_ref_clk(struct device *dev, struct max310x_port *s, /* Wait for crystal */ if (xtal) { - unsigned int val; + unsigned int val = 0; msleep(10); regmap_read(s->regmap, MAX310X_STS_IRQSTS_REG, &val); if (!(val & MAX310X_STS_CLKREADY_BIT)) {