Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2001 14:00:03 -0800 (PST)
From:      Peter Wemm <peter@netplex.com.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/26034: kldload() panics if error code is returned from <module_name>_load(). 
Message-ID:  <200103232200.f2NM03q36535@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/26034; it has been noted by GNATS.

From: Peter Wemm <peter@netplex.com.au>
To: jtrainor@fastekintl.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/26034: kldload() panics if error code is returned from <module_name>_load(). 
Date: Fri, 23 Mar 2001 13:50:52 -0800

 jtrainor@fastekintl.com wrote:
 > 
 > >Number:         26034
 > >Category:       kern
 > >Synopsis:       kldload() panics if error code is returned from <module_name
     >_load().
 
 > >Description:
 > panic trap 12 (page fault) in kldload while attempting to return an error fro
     m <module_name>_load.  If I set the return value prior to entering the case
      statement, proper behavior is observed.  If I set the return value inside 
     the case statement, panic occurs.  See code below.
 
 This is because if you fail on the MOD_LOAD case, the linker calls all the
 MOD_UNLOADs for the modules in the kld file.  In your case, you
 are calling "destroy_dev(sdev);" on MOD_UNLOAD, which is panicing since
 sdev is uninitialized.  This is actually a bug in your module due to the
 existing module load/unload semantics.  Remember, there can be more than
 one module inside a .ko kld file.
 
 One could argue that a MOD_UNLOAD event should be skipped for modules that
 have failed to load successfully..  I think this change needs to happen.
 
 Cheers,
 -Peter
 --
 Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
 "All of this is for nothing if we don't go to the stars" - JMS/B5
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103232200.f2NM03q36535>