linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@linux.dev>
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	[thread overview]
Message-ID: <20250708090403.1067440-5-tiwei.bie@linux.dev> (raw)
In-Reply-To: <20250708090403.1067440-1-tiwei.bie@linux.dev>

From: Tiwei Bie <tiwei.btw@antgroup.com>

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 <tiwei.btw@antgroup.com>
---
 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



      parent reply	other threads:[~2025-07-08  9:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08  9:03 [PATCH 0/4] um: Minor fixes and cleanups Tiwei Bie
2025-07-08  9:04 ` [PATCH 1/4] um: Make unscheduled_userspace_iterations static Tiwei Bie
2025-07-08  9:04 ` [PATCH 2/4] um: Make mm_list and mm_list_lock static Tiwei Bie
2025-07-08  9:04 ` [PATCH 3/4] um: Avoid redefining ARCH_HAS_CACHE_LINE_SIZE Tiwei Bie
2025-07-08  9:04 ` Tiwei Bie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250708090403.1067440-5-tiwei.bie@linux.dev \
    --to=tiwei.bie@linux.dev \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=tiwei.btw@antgroup.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).