Date: Fri, 13 Aug 1999 22:11:02 -0700 (PDT) From: Bill Paul <wpaul@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern subr_bus.c Message-ID: <199908140511.WAA70637@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
wpaul 1999/08/13 22:11:02 PDT Modified files: sys/kern subr_bus.c Log: Grrrr. Fix a really lame bug that I tripped over while testing my miibus stuff: unregister_methods() is horribly broken. The idea, if I'm not mistaken, is that the refcount on a method is decremented, and only when it reaches zero is the method freed. However desc->method is set to NULL unconditionally regardless of the refcount, which means the method pointer is trashed the first time the method is deallocated. The obvious detrimental effect is that memory is leaked. The not so obvious effect is that when you call unregister_method() the second time on the same method, you get a NULL pointer dereference and a panic. Now I can successfully unload network device drivers and the miibus module without crashing the system. *sigh* Revision Changes Path 1.36 +2 -2 src/sys/kern/subr_bus.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908140511.WAA70637>