summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-05-23 12:53:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-22 11:36:53 -0700
commit6a07cbc4ef9cea9f9eabc676fd6b8c03c11f51cc (patch)
tree7fc7336a2993ad8669269ebd908161a17ea7c0eb /drivers
parentebbd13c9d27ab013fdf7005829a80d504b0cb32e (diff)
xen/hvc: Collapse error logic.
commit 2e5ad6b9c45d43cc4e7b8ac5ded1c55a7c4a3893 upstream. All of the error paths are doing the same logic. In which case we might as well collapse them in one path. Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/hvc/hvc_xen.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index d3d91dae065c..afc7fc27aa52 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -216,22 +216,16 @@ static int xen_hvm_console_init(void)
return 0;
r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
- if (r < 0) {
- kfree(info);
- return -ENODEV;
- }
+ if (r < 0)
+ goto err;
info->evtchn = v;
hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v);
- if (r < 0) {
- kfree(info);
- return -ENODEV;
- }
+ if (r < 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 +233,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)