diff options
author | Tiwei Bie <tiwei.btw@antgroup.com> | 2025-07-08 17:04:03 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 16:38:45 +0200 |
commit | f22682d62be85e1fbd792c30e6116179d49ee1cb (patch) | |
tree | e1beb9e35a676a6f73d4a4027d9cd75042b65f07 | |
parent | aabfb553a90e38d4a01297007e70df56a87359dd (diff) |
um: rtc: Avoid shadowing err in uml_rtc_start()
[ Upstream commit 4c916e3b224a02019b3cc3983a15f32bfd9a22df ]
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>
Link: https://patch.msgid.link/20250708090403.1067440-5-tiwei.bie@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | arch/um/drivers/rtc_user.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |