Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351551
b: refs/heads/master
c: bc882b1
h: refs/heads/master
i:
  351549: 49f01a3
  351547: c223762
  351543: d85fb99
  351535: ae187a7
  351519: e04655d
  351487: 2145518
v: v3
  • Loading branch information
Tilman Schmidt authored and David S. Miller committed Jan 21, 2013
1 parent 0b70cb8 commit b5262f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cdc4827098d128423297720dcf33792d85079b78
refs/heads/master: bc882b1880b94d3731b462d3a213885073b350ed
31 changes: 9 additions & 22 deletions trunk/drivers/isdn/gigaset/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,6 @@ void gigaset_freecs(struct cardstate *cs)

mutex_lock(&cs->mutex);

if (!cs->bcs)
goto f_cs;
if (!cs->inbuf)
goto f_bcs;

spin_lock_irqsave(&cs->lock, flags);
cs->running = 0;
spin_unlock_irqrestore(&cs->lock, flags); /* event handler and timer are
Expand Down Expand Up @@ -507,17 +502,16 @@ void gigaset_freecs(struct cardstate *cs)
gig_dbg(DEBUG_INIT, "clearing at_state");
clear_at_state(&cs->at_state);
dealloc_temp_at_states(cs);
clear_events(cs);
tty_port_destroy(&cs->port);

/* fall through */
case 0: /* error in basic setup */
clear_events(cs);
gig_dbg(DEBUG_INIT, "freeing inbuf");
kfree(cs->inbuf);
kfree(cs->bcs);
}
f_bcs: gig_dbg(DEBUG_INIT, "freeing bcs[]");
kfree(cs->bcs);
f_cs: gig_dbg(DEBUG_INIT, "freeing cs");

mutex_unlock(&cs->mutex);
free_cs(cs);
}
Expand Down Expand Up @@ -687,19 +681,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
return NULL;
}

gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1);
cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL);
if (!cs->bcs) {
pr_err("out of memory\n");
goto error;
}
gig_dbg(DEBUG_INIT, "allocating inbuf");
cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL);
if (!cs->inbuf) {
pr_err("out of memory\n");
goto error;
}

cs->cs_init = 0;
cs->channels = channels;
cs->onechannel = onechannel;
Expand Down Expand Up @@ -729,6 +710,12 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
cs->mode = M_UNKNOWN;
cs->mstate = MS_UNINITIALIZED;

cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL);
cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL);
if (!cs->bcs || !cs->inbuf) {
pr_err("out of memory\n");
goto error;
}
++cs->cs_init;

gig_dbg(DEBUG_INIT, "setting up at_state");
Expand Down

0 comments on commit b5262f8

Please sign in to comment.