incorrect parent refcounting in subr_firmware.c?
Navdeep Parhar
nparhar at gmail.com
Wed Nov 2 21:14:40 UTC 2011
On Wed, Nov 2, 2011 at 1:44 PM, Garrett Cooper <yanegomi at gmail.com> wrote:
> On Wed, Nov 2, 2011 at 12:56 PM, Navdeep Parhar <nparhar at gmail.com> wrote:
>> I built a KLD with multiple firmware images, as shown here:
>>
>> KMOD=foo
>> FIRMWS= foo.bin:foo:1.0.0.0
>> FIRMWS+=bar.bin:bar:1.0.0.0
>> FIRMWS+= ...
>> .include <bsd.kmod.mk>
>>
>> "foo" is the parent firmware and a firmware_get(foo) can autoload the
>> KLD. "bar" and the rest are available only if the KLD is loaded (by
>> whatever means). This is reasonable and works as expected. But if I
>> just get and then put "foo" back, the KLD is not unloaded automatically.
>>
>> The problem is that a reference is placed on the parent firmware when
>> the other firmwares are registered (during module load). I think this
>> reference should be placed during firmware_get on the child.
>>
>> What do people think about the attached patch? It fixes things for me.
>
> It might be a generic problem; here's a similar (not exactly the
> same) issue: http://lists.freebsd.org/pipermail/freebsd-hackers/2010-August/032714.html
That seems to be an entirely different issue. My problem is with the
way a "parent" firmware is reference counted.
More information about the freebsd-hackers
mailing list