- Prevent sending status event to dead/kfree sockets
- Disable PPP access before deregistration
PPP deregistration might sleep -> race condition
if(ap->ppp_open)
{
DERROR(FS_ERROR, "Channel still registered - deregistering !\n");
- ppp_unregister_channel(&ap->chan);
ap->ppp_open = 0;
+ ppp_unregister_channel(&ap->chan);
}
kfree(ap);
DEBUG(FS_INFO, "Exiting PPP discipline.\n");
/* Disconnect from the generic PPP layer */
if(ap->ppp_open)
- ppp_unregister_channel(&ap->chan);
+ {
+ ap->ppp_open = 0;
+ ppp_unregister_channel(&ap->chan);
+ }
else
DERROR(FS_ERROR, "Channel not registered !\n");
- ap->ppp_open = 0;
err = 0;
}
break;
ASSERT(self != NULL, return;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
+ /* Check if client has already closed the TSAP and gone away */
+ if (self->close_pend)
+ return;
+
/*
* Inform service user if he has requested it
*/
{
int err;
- /* Check if client has already tried to close the TSAP */
+ /* Check if client has already closed the TSAP and gone away */
if (self->close_pend) {
dev_kfree_skb(skb);
return;