[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0804301442010.9894@shell4.speakeasy.net>
Date: Wed, 30 Apr 2008 14:52:05 -0700 (PDT)
From: Trent Piepho <xyzzy@...akeasy.org>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: Mike Galbraith <efault@....de>, sfr@...b.auug.org.au,
video4linux-list@...hat.com, Sam Ravnborg <sam@...nborg.org>,
linux-kernel@...r.kernel.org, mchehab@...radead.org,
linux-dvb-maintainer@...uxtv.org, Ingo Molnar <mingo@...e.hu>,
torvalds@...ux-foundation.org, David Miller <davem@...emloft.net>
Subject: Re: [v4l-dvb-maintainer] [patch, -git] drivers/media build fix for
modular builds
On Wed, 30 Apr 2008, Andrew Morton wrote:
> Does this make it feel better?
>
> --- a/drivers/media/video/tuner-core.c~a
> +++ a/drivers/media/video/tuner-core.c
> @@ -40,11 +40,11 @@
> typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
> if (__a) { \
> __r = (int) __a(ARGS); \
> + symbol_put(FUNCTION); \
> } else { \
> printk(KERN_ERR "TUNER: Unable to find " \
> "symbol "#FUNCTION"()\n"); \
> } \
> - symbol_put(FUNCTION); \
> __r; \
> })
Should the symbol_put be done at all? When I wrote the code this is based
on, it would check if FUNCTION failed or not. If it failed, the symbol was
put. But if it worked, then one was returned a handle into FUNCTION's
module, and so the symbol was not put. If it was, the module's refcount
would be zero but the caller would have a handle into the module.
So if FUNCTION does anything that creates references to the module, and it
doesn't inc it's own refcount, then the symbol_put shouldn't be done.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists