Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: rtc: Avoid shadowing err in uml_rtc_start()

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>

authored by

Tiwei Bie and committed by
Johannes Berg
4c916e3b 5d2c5b8c

+1 -1
+1 -1
arch/um/drivers/rtc_user.c
··· 28 28 int err; 29 29 30 30 if (timetravel) { 31 - int err = os_pipe(uml_rtc_irq_fds, 1, 1); 31 + err = os_pipe(uml_rtc_irq_fds, 1, 1); 32 32 if (err) 33 33 goto fail; 34 34 } else {