Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1368112c authored by Karsten Keil's avatar Karsten Keil Committed by David S. Miller
Browse files

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: default avatarKarsten Keil <kkeil@linux-pingi.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd456d45
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -839,14 +839,10 @@ avm_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(&fc->lock, flags);
		mISDN_freebchannel(bch);
			test_and_clear_bit(FLG_TX_BUSY, &bch->Flags);
			test_and_clear_bit(FLG_ACTIVE, &bch->Flags);
		modehdlc(bch, ISDN_P_NONE);
		spin_unlock_irqrestore(&fc->lock, flags);
		}
		ch->protocol = ISDN_P_NONE;
		ch->peer = NULL;
		module_put(THIS_MODULE);
+1 −2
Original line number Diff line number Diff line
@@ -3725,7 +3725,6 @@ hfcm_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
	switch (cmd) {
	case CLOSE_CHANNEL:
		test_and_clear_bit(FLG_OPEN, &bch->Flags);
		if (test_bit(FLG_ACTIVE, &bch->Flags))
		deactivate_bchannel(bch); /* locked there */
		ch->protocol = ISDN_P_NONE;
		ch->peer = NULL;
+1 −2
Original line number Diff line number Diff line
@@ -1581,7 +1581,6 @@ hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
		break;
	case CLOSE_CHANNEL:
		test_and_clear_bit(FLG_OPEN, &bch->Flags);
		if (test_bit(FLG_ACTIVE, &bch->Flags))
		deactivate_bchannel(bch);
		ch->protocol = ISDN_P_NONE;
		ch->peer = NULL;
+1 −2
Original line number Diff line number Diff line
@@ -1836,7 +1836,6 @@ hfc_bctrl(struct mISDNchannel *ch, u_int cmd, void *arg)

	case CLOSE_CHANNEL:
		test_and_clear_bit(FLG_OPEN, &bch->Flags);
		if (test_bit(FLG_ACTIVE, &bch->Flags))
		deactivate_bchannel(bch);
		ch->protocol = ISDN_P_NONE;
		ch->peer = NULL;
+4 −9
Original line number Diff line number Diff line
@@ -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;
		}
		ch->protocol = ISDN_P_NONE;
		ch->peer = NULL;
		module_put(hx->ip->owner);
Loading