From: Greg KH <greg@kroah.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: exported symbols
Date: Sat, 19 Sep 2009 22:40:04 +0000 [thread overview]
Message-ID: <20090919224004.GA9567@kroah.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0909182336590.4238@ask.diku.dk>
On Fri, Sep 18, 2009 at 11:39:34PM +0200, Julia Lawall wrote:
> Functions that are exported using EXPORT_SYMBOL, and thus are presumably
> freely available for use in dynamically loaded modules, do not seem to
> very often check the validity of their inputs. For a simple example,
> the following code from arch/arm/mach-realview/clock.c does not even check
> that clk is not NULL:
>
> unsigned long clk_get_rate(struct clk *clk)
> {
> return clk->rate;
> }
> EXPORT_SYMBOL(clk_get_rate);
>
> Is this a problem?
No, as long as all callers are not passing NULL :)
Seriously, it's not an issue, putting error checking for everything
causes a lot of extra code for no reason, as we can easily audit all
callers of these symbols, it is not always necessary to check the
paramters.
thanks,
greg k-h
next prev parent reply other threads:[~2009-09-19 22:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 21:39 exported symbols Julia Lawall
2009-09-19 22:40 ` Greg KH [this message]
2009-09-20 5:21 ` Julia Lawall
2009-09-20 15:07 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090919224004.GA9567@kroah.com \
--to=greg@kroah.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.