mISDN: Cleanup channel also if it already was deactivated

If a channel was closed after it was deactivated it could happen that
something was not proper resetted. The test if a channel is still activ
was wrong, so remove it and always do the cleanup.

Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
此提交包含在:
Karsten Keil
2012-05-15 23:51:01 +00:00
提交者 David S. Miller
父節點 dd456d45d7
當前提交 1368112c07
共有 8 個檔案被更改,包括 23 行新增49 行删除

查看文件

@@ -1420,15 +1420,10 @@ hscx_bctrl(struct mISDNchannel *ch, u32 cmd, void *arg)
switch (cmd) {
case CLOSE_CHANNEL:
test_and_clear_bit(FLG_OPEN, &bch->Flags);
if (test_bit(FLG_ACTIVE, &bch->Flags)) {
spin_lock_irqsave(hx->ip->hwlock, flags);
mISDN_freebchannel(bch);
hscx_mode(hx, ISDN_P_NONE);
spin_unlock_irqrestore(hx->ip->hwlock, flags);
} else {
skb_queue_purge(&bch->rqueue);
bch->rcount = 0;
}
spin_lock_irqsave(hx->ip->hwlock, flags);
mISDN_freebchannel(bch);
hscx_mode(hx, ISDN_P_NONE);
spin_unlock_irqrestore(hx->ip->hwlock, flags);
ch->protocol = ISDN_P_NONE;
ch->peer = NULL;
module_put(hx->ip->owner);