From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D50CC8303C for ; Tue, 8 Jul 2025 09:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=paWxJYw1tad65a3EgKuRdepj3PsWT5g2t5nygkzLcIw=; b=2iGkaCcHbzHTtoIwuO6oi1OTYP f9cQLCPKO37FPbznGA3zmD/A5f3rzyUK4zDQAMvBA7ZtbPRpM1O9bvDtvD5ao3DUI50Am+CAfq8WQ Oh6FdqL00zvKKpHccijtMiw4HpRRn9qKlzUj0BG9bzVCxdVuZqxD+M6thasqvvfQnz4uS5Oc5cWG2 lR6PZkYtZi5AIUIwlJcmyBDCfrpCTv6CsK8WJufD+lYOWiyIE9cBdMOvBhvGxJcrXP5Lh3XV6lXzK DPezTm6THgGHhaW2FTIvwRDqXhiCBf86ps7WqcBvBRW7jiHLo1PsV4Uhd8NwiC2bsfdi1/PB1M2fW czdIBbAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uZ4v4-00000004vXO-43l8; Tue, 08 Jul 2025 09:47:22 +0000 Received: from out-182.mta1.migadu.com ([2001:41d0:203:375::b6]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uZ4Fj-00000004qN4-0KIQ for linux-um@lists.infradead.org; Tue, 08 Jul 2025 09:04:40 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1751965477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=paWxJYw1tad65a3EgKuRdepj3PsWT5g2t5nygkzLcIw=; b=SzmW15BmHoviB8p2P3+5dhrcZsCd7sFM3YlUFOM3FRzm8e+nQAsXUpSF3RKtSfuJRcFu1K KvgqH0Gb9M69CaNn0CoF+MgZ6zLZQgpXUInbJsMXxd8Fhz+sUZFsVxVSZPfQXJSNJEBnsd 7S8Gofmzqa5HbTV9q5b7HxwwV6nZ+UM= From: Tiwei Bie To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: linux-um@lists.infradead.org, tiwei.btw@antgroup.com, tiwei.bie@linux.dev Subject: [PATCH 4/4] um: rtc: Avoid shadowing err in uml_rtc_start() Date: Tue, 8 Jul 2025 17:04:03 +0800 Message-Id: <20250708090403.1067440-5-tiwei.bie@linux.dev> In-Reply-To: <20250708090403.1067440-1-tiwei.bie@linux.dev> References: <20250708090403.1067440-1-tiwei.bie@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250708_020439_261018_6D50DC84 X-CRM114-Status: UNSURE ( 8.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org From: Tiwei Bie Remove the declaration of 'err' inside the 'if (timetravel)' block, as it would otherwise be unavailable outside that block, potentially leading to uml_rtc_start() returning an uninitialized value. Fixes: dde8b58d5127 ("um: add a pseudo RTC") Signed-off-by: Tiwei Bie --- arch/um/drivers/rtc_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/drivers/rtc_user.c b/arch/um/drivers/rtc_user.c index 51e79f3148cd..67912fcf7b28 100644 --- a/arch/um/drivers/rtc_user.c +++ b/arch/um/drivers/rtc_user.c @@ -28,7 +28,7 @@ int uml_rtc_start(bool timetravel) int err; if (timetravel) { - int err = os_pipe(uml_rtc_irq_fds, 1, 1); + err = os_pipe(uml_rtc_irq_fds, 1, 1); if (err) goto fail; } else { -- 2.34.1