Skip to content

Commit

Permalink
WAN: flush tx_queue in hdlc_ppp to prevent panic on rmmod hw_driver.
Browse files Browse the repository at this point in the history
tx_queue is used as a temporary queue when not allowed to queue skb
directly to the hw device driver (which may sleep). Most paths flush
it before returning, but ppp_start() currently cannot. Make sure we
don't leave skbs pointing to a non-existent device.

Thanks to Michael Barkowski for reporting this problem.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Krzysztof Halasa authored and David S. Miller committed Apr 16, 2010
1 parent 334656f commit 31f634a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/wan/hdlc_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,15 @@ static void ppp_stop(struct net_device *dev)
ppp_cp_event(dev, PID_LCP, STOP, 0, 0, 0, NULL);
}

static void ppp_close(struct net_device *dev)
{
ppp_tx_flush();
}

static struct hdlc_proto proto = {
.start = ppp_start,
.stop = ppp_stop,
.close = ppp_close,
.type_trans = ppp_type_trans,
.ioctl = ppp_ioctl,
.netif_rx = ppp_rx,
Expand Down

0 comments on commit 31f634a

Please sign in to comment.