mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-14 17:53:39 +00:00
xen/hvc: Collapse error logic.
All of the error paths are doing the same logic. In which case we might as well collapse them in one path. CC: stable@kernel.org Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
parent
68c2c39a76
commit
2e5ad6b9c4
@ -216,22 +216,16 @@ static int xen_hvm_console_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
|
r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
|
||||||
if (r < 0) {
|
if (r < 0)
|
||||||
kfree(info);
|
goto err;
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
info->evtchn = v;
|
info->evtchn = v;
|
||||||
hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v);
|
hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v);
|
||||||
if (r < 0) {
|
if (r < 0)
|
||||||
kfree(info);
|
goto err;
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
mfn = v;
|
mfn = v;
|
||||||
info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE);
|
info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE);
|
||||||
if (info->intf == NULL) {
|
if (info->intf == NULL)
|
||||||
kfree(info);
|
goto err;
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
info->vtermno = HVC_COOKIE;
|
info->vtermno = HVC_COOKIE;
|
||||||
|
|
||||||
spin_lock(&xencons_lock);
|
spin_lock(&xencons_lock);
|
||||||
@ -239,6 +233,9 @@ static int xen_hvm_console_init(void)
|
|||||||
spin_unlock(&xencons_lock);
|
spin_unlock(&xencons_lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
err:
|
||||||
|
kfree(info);
|
||||||
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xen_pv_console_init(void)
|
static int xen_pv_console_init(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user