[346] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Fix for ppp module usage count

daemon@ATHENA.MIT.EDU (Bjorn Ekwall)
Fri May 19 14:44:21 1995

From: bj0rn@blox.se (Bjorn Ekwall)
To: longyear@netcom.com (Al Longyear)
Date: Fri, 19 May 1995 19:32:48 +0200 (CET)
Cc: linux-ppp@vger.rutgers.edu, linux-net@vger.rutgers.edu

Hi!

As I was testing the automatic module loading and unloading
that I and Jacques Gelinas are working on, I found a small
buglet in ppp.c
The following patch makes it possible to unload the ppp module
after having used it... At least I _think_ that I have put
the MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT in the right places
(or should they be in ppp_dev_open() and ppp_dev_close()? ).

Greetings,

Bjorn Ekwall <bj0rn@blox.se>


*** linux/drivers/net/ppp.c.org	Mon May 15 20:19:24 1995
--- linux/drivers/net/ppp.c	Fri May 19 19:14:53 1995
***************
*** 505,510 ****
--- 505,513 ----
      ppp_release (ppp);
  
      PRINTKN (2,(KERN_INFO "ppp: channel %s closing.\n", ppp->dev->name));
+ #ifdef MODULE
+     MOD_DEC_USE_COUNT;
+ #endif
    }
  }
  
***************
*** 613,621 ****
    PRINTKN (2,(KERN_INFO "ppp: channel %s going down for IP packets!\n",
  	      dev->name));
    CHECK_PPP(-ENXIO);
- #ifdef MODULE
-   MOD_DEC_USE_COUNT;
- #endif
    return 0;
  }
  
--- 616,621 ----

home help back first fref pref prev next nref lref last post