Devin Butterfield wrote:
> 
> Hi all,
> 
> In the process of learning device driver writing, I have written a
> simple skeleton driver for an isa PnP card I have.
> 
> Although this driver works (successfully probes, attaches, and gets it's
> needed io resources) when compiled into the kernel, if I compile it as a
> loadable module it fails to get it's io resources when loaded, and if I
> try to then unload it, the kernel panics (as the driver trys to release
> resources that were never allocated).

I can't help you with *why* you aren't getting the resources you need, but...

If your module is not able to get all the resources you need, you should
be failing the loading of the module.  When failing the loading, you
should free up any resources you *did* successfully grab before returning.
Then you won't be causing a panic when trying to free resources during unload,
since you'll never have finished loading in the first place.  That is, unload
won't be called unless you were successfully loaded.

Gary


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to