hvc/xen: fix error path in xen_hvc_init() to always register frontend driver
commit 2704c9a5593f4a47620c12dad78838ca62b52f48 upstream. 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b05c285bc5
commit
19f8fa7bf1
@@ -587,7 +587,7 @@ static int __init xen_hvc_init(void)
|
|||||||
ops = &dom0_hvc_ops;
|
ops = &dom0_hvc_ops;
|
||||||
r = xen_initial_domain_console_init();
|
r = xen_initial_domain_console_init();
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
goto register_fe;
|
||||||
info = vtermno_to_xencons(HVC_COOKIE);
|
info = vtermno_to_xencons(HVC_COOKIE);
|
||||||
} else {
|
} else {
|
||||||
ops = &domU_hvc_ops;
|
ops = &domU_hvc_ops;
|
||||||
@@ -596,7 +596,7 @@ static int __init xen_hvc_init(void)
|
|||||||
else
|
else
|
||||||
r = xen_pv_console_init();
|
r = xen_pv_console_init();
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
goto register_fe;
|
||||||
|
|
||||||
info = vtermno_to_xencons(HVC_COOKIE);
|
info = vtermno_to_xencons(HVC_COOKIE);
|
||||||
info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
|
info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
|
||||||
@@ -621,6 +621,7 @@ static int __init xen_hvc_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
r = 0;
|
r = 0;
|
||||||
|
register_fe:
|
||||||
#ifdef CONFIG_HVC_XEN_FRONTEND
|
#ifdef CONFIG_HVC_XEN_FRONTEND
|
||||||
r = xenbus_register_frontend(&xencons_driver);
|
r = xenbus_register_frontend(&xencons_driver);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user