Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Aug 2000 15:11:44 -0400
From:      "Gary T. Corcoran" <garycor@home.com>
To:        Devin Butterfield <dbutter@wireless.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: "Unknown" driver gobbles resources??
Message-ID:  <3996F2F0.AF52779@home.com>
References:  <200008112235.PAA00839@mass.osd.bsdi.com> <39953196.1103F555@wireless.net> <200008121302.JAA00442@jupiter.delta.ny.us> <39969072.EED2B8F6@wireless.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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