summaryrefslogtreecommitdiff
path: root/drivers/isdn/mISDN/layer2.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-08-25 12:07:13 +0300
committerIngo Molnar <mingo@kernel.org>2017-08-25 12:07:13 +0300
commit3a9ff4fd04cc6ad199419508c8ea6eb839e0262d (patch)
treef3933b082ea1743e63e93a16190c6ce32175c96a /drivers/isdn/mISDN/layer2.c
parent9c8783201cb58e9af8ddeb0cc68f37b0a44ca16c (diff)
parent90a6cd503982bfd33ce8c70eb49bd2dd33bc6325 (diff)
downloadlinux-3a9ff4fd04cc6ad199419508c8ea6eb839e0262d.tar.xz
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/isdn/mISDN/layer2.c')
-rw-r--r--drivers/isdn/mISDN/layer2.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
index 7243a6746f8b..9ff0903a0e89 100644
--- a/drivers/isdn/mISDN/layer2.c
+++ b/drivers/isdn/mISDN/layer2.c
@@ -2247,15 +2247,26 @@ static struct Bprotocol X75SLP = {
int
Isdnl2_Init(u_int *deb)
{
+ int res;
debug = deb;
mISDN_register_Bprotocol(&X75SLP);
l2fsm.state_count = L2_STATE_COUNT;
l2fsm.event_count = L2_EVENT_COUNT;
l2fsm.strEvent = strL2Event;
l2fsm.strState = strL2State;
- mISDN_FsmNew(&l2fsm, L2FnList, ARRAY_SIZE(L2FnList));
- TEIInit(deb);
+ res = mISDN_FsmNew(&l2fsm, L2FnList, ARRAY_SIZE(L2FnList));
+ if (res)
+ goto error;
+ res = TEIInit(deb);
+ if (res)
+ goto error_fsm;
return 0;
+
+error_fsm:
+ mISDN_FsmFree(&l2fsm);
+error:
+ mISDN_unregister_Bprotocol(&X75SLP);
+ return res;
}
void