diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-05-23 12:53:11 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-05-24 14:15:29 -0400 |
commit | 2e5ad6b9c45d43cc4e7b8ac5ded1c55a7c4a3893 (patch) | |
tree | e6d9527fcf3e227e8a3f8e889bcce00fc11b46c4 | |
parent | 68c2c39a76b094e9b2773e5846424ea674bf2c46 (diff) |
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>
-rw-r--r-- | drivers/tty/hvc/hvc_xen.c | 21 |
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) | |||
216 | return 0; | 216 | return 0; |
217 | 217 | ||
218 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v); | 218 | r = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v); |
219 | if (r < 0) { | 219 | if (r < 0) |
220 | kfree(info); | 220 | goto err; |
221 | return -ENODEV; | ||
222 | } | ||
223 | info->evtchn = v; | 221 | info->evtchn = v; |
224 | hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); | 222 | hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v); |
225 | if (r < 0) { | 223 | if (r < 0) |
226 | kfree(info); | 224 | goto err; |
227 | return -ENODEV; | ||
228 | } | ||
229 | mfn = v; | 225 | mfn = v; |
230 | info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); | 226 | info->intf = ioremap(mfn << PAGE_SHIFT, PAGE_SIZE); |
231 | if (info->intf == NULL) { | 227 | if (info->intf == NULL) |
232 | kfree(info); | 228 | goto err; |
233 | return -ENODEV; | ||
234 | } | ||
235 | info->vtermno = HVC_COOKIE; | 229 | info->vtermno = HVC_COOKIE; |
236 | 230 | ||
237 | spin_lock(&xencons_lock); | 231 | spin_lock(&xencons_lock); |
@@ -239,6 +233,9 @@ static int xen_hvm_console_init(void) | |||
239 | spin_unlock(&xencons_lock); | 233 | spin_unlock(&xencons_lock); |
240 | 234 | ||
241 | return 0; | 235 | return 0; |
236 | err: | ||
237 | kfree(info); | ||
238 | return -ENODEV; | ||
242 | } | 239 | } |
243 | 240 | ||
244 | static int xen_pv_console_init(void) | 241 | static int xen_pv_console_init(void) |