Date: Tue, 20 Apr 2010 17:40:03 GMT From: Mateusz Guzik <mjguzik@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/145865: kernel memory leak with disabled devd and hw.bus.devctl_disable=1 Message-ID: <201004201740.o3KHe3MX001120@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/145865; it has been noted by GNATS. From: Mateusz Guzik <mjguzik@gmail.com> To: bug-followup@FreeBSD.org, littlesavage@orionet.ru Cc: Subject: Re: kern/145865: kernel memory leak with disabled devd and hw.bus.devctl_disable=1 Date: Tue, 20 Apr 2010 19:33:28 +0200 devctl_queue_length is checked twice. 1) if (devctl_queue_length == 0) return; So we leak message passed by the caller. 2) mtx_lock(&devsoftc.mtx); if (devctl_queue_length == 0) { free(n1->dei_data, M_BUS); free(n1, M_BUS); return; } So we can return with lock held where we shouldn't (or I'm misinterpreting something). How about this patch then: http://student.agh.edu.pl/~mjguzik/subr_bus.diff -- Mateusz Guzik
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004201740.o3KHe3MX001120>