aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Tabi <timur@codeaurora.org>2015-09-12 13:44:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 12:49:27 -0400
commit3d27070108216b5c689dd3d0bf3ac10ef88570f7 (patch)
treef1e776a9f5b91c23b66569ddb908fef5bc3da3d6
parent9af92fbff3b06d75470717361076aa7bd097ff8b (diff)
hvc_dcc: don't ignore errors during initialization
hvc_instantiate() and hvc_alloc() return errors if they fail, so don't ignore them. Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/hvc/hvc_dcc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c
index 809920d80a66..82f240fb98f0 100644
--- a/drivers/tty/hvc/hvc_dcc.c
+++ b/drivers/tty/hvc/hvc_dcc.c
@@ -70,20 +70,27 @@ static const struct hv_ops hvc_dcc_get_put_ops = {
70 70
71static int __init hvc_dcc_console_init(void) 71static int __init hvc_dcc_console_init(void)
72{ 72{
73 int ret;
74
73 if (!hvc_dcc_check()) 75 if (!hvc_dcc_check())
74 return -ENODEV; 76 return -ENODEV;
75 77
76 hvc_instantiate(0, 0, &hvc_dcc_get_put_ops); 78 /* Returns -1 if error */
77 return 0; 79 ret = hvc_instantiate(0, 0, &hvc_dcc_get_put_ops);
80
81 return ret < 0 ? -ENODEV : 0;
78} 82}
79console_initcall(hvc_dcc_console_init); 83console_initcall(hvc_dcc_console_init);
80 84
81static int __init hvc_dcc_init(void) 85static int __init hvc_dcc_init(void)
82{ 86{
87 struct hvc_struct *p;
88
83 if (!hvc_dcc_check()) 89 if (!hvc_dcc_check())
84 return -ENODEV; 90 return -ENODEV;
85 91
86 hvc_alloc(0, 0, &hvc_dcc_get_put_ops, 128); 92 p = hvc_alloc(0, 0, &hvc_dcc_get_put_ops, 128);
87 return 0; 93
94 return PTR_ERR_OR_ZERO(p);
88} 95}
89device_initcall(hvc_dcc_init); 96device_initcall(hvc_dcc_init);