mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
mini-os: avoid crash if no console is provided
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
This commit is contained in:
1 parent
6a2de353a9
commit
d45361b2ae
1 file changed
+6
-1
@@ -25,7 +25,10 @@ static inline void notify_daemon(struct consfront_dev *dev)
|
||||
|
||||
static inline struct xencons_interface *xencons_interface(void)
|
||||
{
|
||||
return mfn_to_virt(start_info.console.domU.mfn);
|
||||
if (start_info.console.domU.evtchn)
|
||||
return mfn_to_virt(start_info.console.domU.mfn);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int xencons_ring_send_no_notify(struct consfront_dev *dev, const char *data, unsigned len)
|
||||
@@ -38,6 +41,8 @@ int xencons_ring_send_no_notify(struct consfront_dev *dev, const char *data, uns
|
||||
intf = xencons_interface();
|
||||
else
|
||||
intf = dev->ring;
|
||||
if (!intf)
|
||||
return sent;
|
||||
|
||||
cons = intf->out_cons;
|
||||
prod = intf->out_prod;
|
||||
|
||||