diff options
author | Hendrik Brueckner <brueckner@linux.vnet.ibm.com> | 2010-10-25 10:10:22 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-10-25 10:10:17 -0400 |
commit | c77f7cf74b9bc0e56c8698097228c1784e9f03c9 (patch) | |
tree | c6ca3e9741ec36318fc58f11804a0027534b2aca | |
parent | a20852d2b7ca3c6e7b232eecf09631b66dde2a46 (diff) |
[S390] hvc_iucv: do not call iucv_unregister if iucv_register failed
If the iucv_register() functions fails, the error recovery calls
iucv_unregister() which might cause the following stack backtrace:
(<0000000000100ab2> show_trace+0xee/0x144)
<00000000004f1842> panic+0xb6/0x248
<00000000001010a6> die+0x15a/0x16c
<000000000011d936> do_no_context+0xa6/0xe4
<00000000004f84dc> do_protection_exception+0x2e8/0x3a4
<0000000000113afc> pgm_exit+0x0/0x14
<00000000004e786e> iucv_unregister+0x5a/0x17c
(<00000000004e785e> iucv_unregister+0x4a/0x17c)
<000000000076de74> hvc_iucv_init+0x228/0x5dc
<00000000001000c2> do_one_initcall+0x3e/0x19c
<00000000007524a2> kernel_init+0x28e/0x404
<0000000000105dd6> kernel_thread_starter+0x6/0xc
<0000000000105dd0> kernel_thread_starter+0x0/0xc
Remove the call to iucv_unregister() and remove the goto label
as unregistering is the last step in the hvc_iucv initialization.
If iucv_register() fails, simply clean up hvc terminals and free
resources.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/char/hvc_iucv.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/hvc_iucv.c b/drivers/char/hvc_iucv.c index 7b01bc609de3..c3425bb3a1f6 100644 --- a/drivers/char/hvc_iucv.c +++ b/drivers/char/hvc_iucv.c | |||
@@ -1303,13 +1303,11 @@ static int __init hvc_iucv_init(void) | |||
1303 | if (rc) { | 1303 | if (rc) { |
1304 | pr_err("Registering IUCV handlers failed with error code=%d\n", | 1304 | pr_err("Registering IUCV handlers failed with error code=%d\n", |
1305 | rc); | 1305 | rc); |
1306 | goto out_error_iucv; | 1306 | goto out_error_hvc; |
1307 | } | 1307 | } |
1308 | 1308 | ||
1309 | return 0; | 1309 | return 0; |
1310 | 1310 | ||
1311 | out_error_iucv: | ||
1312 | iucv_unregister(&hvc_iucv_handler, 0); | ||
1313 | out_error_hvc: | 1311 | out_error_hvc: |
1314 | for (i = 0; i < hvc_iucv_devices; i++) | 1312 | for (i = 0; i < hvc_iucv_devices; i++) |
1315 | if (hvc_iucv_table[i]) | 1313 | if (hvc_iucv_table[i]) |