[PATCH] fix PPP panic

From: Paul Mackerras (paulus@linuxcare.com.au)
Date: Mon Apr 17 2000 - 07:31:09 EST


Here is a patch which fixes a problem noted by Michal Ostrowski where
the PPP driver can cause a panic at the point where a link is taken
down. The patch is against 2.3.99-pre6-pre3.

Paul.

diff -urN official/drivers/net/ppp_generic.c linux/drivers/net/ppp_generic.c
--- official/drivers/net/ppp_generic.c Thu Apr 13 22:45:43 2000
+++ linux/drivers/net/ppp_generic.c Mon Apr 17 15:43:13 2000
@@ -19,7 +19,7 @@
  * PPP driver, written by Michael Callahan and Al Longyear, and
  * subsequently hacked by Paul Mackerras.
  *
- * ==FILEVERSION 20000412==
+ * ==FILEVERSION 20000417==
  */
 
 #include <linux/config.h>
@@ -2374,6 +2374,7 @@
 {
         struct ppp *ppp;
         int err = -EINVAL;
+ int dead;
 
         write_lock_bh(&pch->upl);
         ppp = pch->ppp;
@@ -2383,12 +2384,12 @@
                 ppp_lock(ppp);
                 list_del(&pch->clist);
                 --ppp->n_channels;
- if (ppp->dev == 0 && ppp->n_channels == 0)
+ dead = ppp->dev == 0 && ppp->n_channels == 0;
+ ppp_unlock(ppp);
+ if (dead)
                         /* Last disconnect from a ppp unit
                            that is already dead: free it. */
                         kfree(ppp);
- else
- ppp_unlock(ppp);
                 err = 0;
         }
         write_unlock_bh(&pch->upl);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:10 EST