if (!pch)
return -ENODEV;
- chan = READ_ONCE(pch->chan);
- if (!chan)
- return -ENODEV;
-
+ chan = pch->chan;
if (!chan->ops->fill_forward_path)
return -EOPNOTSUPP;
spin_lock(&pch->downl);
chan = pch->chan;
- if (unlikely(!chan || (!chan->direct_xmit && skb_linearize(skb)))) {
- /* channel got unregistered, or it requires a linear
- * skb but linearization failed
+ if (unlikely(!chan->direct_xmit && skb_linearize(skb))) {
+ /* channel requires a linear skb but linearization
+ * failed
*/
kfree_skb(skb);
ret = 1;
hdrlen = (ppp->flags & SC_MP_XSHORTSEQ)? MPHDRLEN_SSN: MPHDRLEN;
i = 0;
list_for_each_entry(pch, &ppp->channels, clist) {
- if (pch->chan) {
- pch->avail = 1;
- navail++;
- pch->speed = pch->chan->speed;
- } else {
- pch->avail = 0;
- }
- if (pch->avail) {
- if (skb_queue_empty(&pch->file.xq) ||
- !pch->had_frag) {
- if (pch->speed == 0)
- nzero++;
- else
- totspeed += pch->speed;
-
- pch->avail = 2;
- ++nfree;
- ++totfree;
- }
- if (!pch->had_frag && i < ppp->nxchan)
- ppp->nxchan = i;
+ pch->avail = 1;
+ navail++;
+ pch->speed = pch->chan->speed;
+
+ if (skb_queue_empty(&pch->file.xq) || !pch->had_frag) {
+ if (pch->speed == 0)
+ nzero++;
+ else
+ totspeed += pch->speed;
+
+ pch->avail = 2;
+ ++nfree;
+ ++totfree;
}
+ if (!pch->had_frag && i < ppp->nxchan)
+ ppp->nxchan = i;
+
++i;
}
/*
pch->avail = 1;
}
- /* check the channel's mtu and whether it is still attached. */
spin_lock(&pch->downl);
- if (pch->chan == NULL) {
- /* can't use this channel, it's being deregistered */
- if (pch->speed == 0)
- nzero--;
- else
- totspeed -= pch->speed;
-
- spin_unlock(&pch->downl);
- pch->avail = 0;
- totlen = len;
- totfree--;
- nfree--;
- if (--navail == 0)
- break;
- continue;
- }
-
/*
*if the channel speed is not set divide
*the packet evenly among the free channels;
ppp_disconnect_channel(pch);
down_write(&pch->chan_sem);
spin_lock_bh(&pch->downl);
- WRITE_ONCE(pch->chan, NULL);
+ pch->chan = NULL;
spin_unlock_bh(&pch->downl);
up_write(&pch->chan_sem);