Skip to content

Commit 4c916e3

Browse files
btw616jmberg-intel
authored andcommitted
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: dde8b58 ("um: add a pseudo RTC") Signed-off-by: Tiwei Bie <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 5d2c5b8 commit 4c916e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/um/drivers/rtc_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int uml_rtc_start(bool timetravel)
2828
int err;
2929

3030
if (timetravel) {
31-
int err = os_pipe(uml_rtc_irq_fds, 1, 1);
31+
err = os_pipe(uml_rtc_irq_fds, 1, 1);
3232
if (err)
3333
goto fail;
3434
} else {

0 commit comments

Comments
 (0)