diff options
author | Bo Yan <byan@nvidia.com> | 2012-07-09 14:11:09 -0700 |
---|---|---|
committer | Bo Yan <byan@nvidia.com> | 2012-07-09 14:11:09 -0700 |
commit | 5056dc8ccaa3cbafad5ae8eaeceec2994da3cfe5 (patch) | |
tree | c3c9f44c314ff2b190eccdff13258bf5df078cc5 /drivers/tty | |
parent | f092a6eca1da1086c4b4a2a6893b53d1997dc58d (diff) | |
parent | e69322319507d5d3f916498fe326499d4f5d46b3 (diff) |
Merge remote branch 'origin/android-tegra-nv-3.4' into tot
Conflicts:
arch/arm/mach-imx/hotplug.c
Change-Id: I33c5f2e4c2d556c09173be3c5fd36bf59f7c9ca8
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/hvc/hvc_xen.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index d3d91dae065c..944eaeb8e0cf 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -214,24 +214,24 @@ static int xen_hvm_console_init(void) /* already configured */ if (info->intf != NULL) return 0; - + /* + * If the toolstack (or the hypervisor) hasn't set these values, the + * default value is 0. Even though mfn = 0 and evtchn = 0 are + * theoretically correct values, in practice they never are and they + * mean that a legacy toolstack hasn't initialized the pv console correctly. + */ r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v); - if (r < 0) { - kfree(info); - return -ENODEV; - } + if (r < 0 || v == 0) + goto err; info->evtchn = v; - hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); - if (r < 0) { - kfree(info); - return -ENODEV; - } + v = 0; + r = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); + if (r < 0 || v == 0) + goto err; mfn = v; info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); - if (info->intf == NULL) { - kfree(info); - return -ENODEV; - } + if (info->intf == NULL) + goto err; info->vtermno = HVC_COOKIE; spin_lock(&xencons_lock); @@ -239,6 +239,9 @@ static int xen_hvm_console_init(void) spin_unlock(&xencons_lock); return 0; +err: + kfree(info); + return -ENODEV; } static int xen_pv_console_init(void) |