Skip to content

Commit 2704c9a

Browse files
dwmw2gregkh
authored andcommitted
hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
The xen_hvc_init() function should always register the frontend driver, even when there's no primary console — as there may be secondary consoles. (Qemu can always add secondary consoles, but only the toolstack can add the primary because it's special.) Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Juergen Gross <jgross@suse.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231020161529.355083-3-dwmw2@infradead.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ef5dd8e commit 2704c9a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/tty/hvc/hvc_xen.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ static int __init xen_hvc_init(void)
588588
ops = &dom0_hvc_ops;
589589
r = xen_initial_domain_console_init();
590590
if (r < 0)
591-
return r;
591+
goto register_fe;
592592
info = vtermno_to_xencons(HVC_COOKIE);
593593
} else {
594594
ops = &domU_hvc_ops;
@@ -597,7 +597,7 @@ static int __init xen_hvc_init(void)
597597
else
598598
r = xen_pv_console_init();
599599
if (r < 0)
600-
return r;
600+
goto register_fe;
601601

602602
info = vtermno_to_xencons(HVC_COOKIE);
603603
info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
@@ -622,6 +622,7 @@ static int __init xen_hvc_init(void)
622622
}
623623

624624
r = 0;
625+
register_fe:
625626
#ifdef CONFIG_HVC_XEN_FRONTEND
626627
r = xenbus_register_frontend(&xencons_driver);
627628
#endif

0 commit comments

Comments
 (0)