|
@@ -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)
|