From: Chen Gang <gang.chen@asianux.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel: kallsyms: parameters checking, for EXPORT_SYMBOL_GPL functions
Date: Wed, 10 Apr 2013 18:56:23 +0800 [thread overview]
Message-ID: <51654557.3000308@asianux.com> (raw)
In-Reply-To: <871uai7tzu.fsf@rustcorp.com.au>
On 2013年04月10日 14:57, Rusty Russell wrote:
> Chen Gang <gang.chen@asianux.com> writes:
>> > for EXPORT_SYMBOL_GPL functions, necessary to check their parameters.
>> >
>> > Signed-off-by: Chen Gang <gang.chen@asianux.com>
> Why?
>
> If someone misuses these functions, they crash and thus indicate that
> the caller shouldn't do that.
>
for me, I think:
if it is used by self (such as static functions):
I prefer to crash immediatly.
it will help us to find issue, quickly.
if it can be used by others (such as EXPORT_SYMBOL_GPL):
I prefer to return fail and tell caller that parameter is invalid.
it is more polite to callers, and still indicate it may be an issue.
:-)
> Or is someone already doing this?
>
really has:
kernel: __wake_up_sync_key in kernel/sched/core.c.
lib: *printf.
mm: kfree.
> Confused,
> Rusty.
>
--
Chen Gang
Asianux Corporation
next prev parent reply other threads:[~2013-04-10 10:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 6:00 [PATCH] kernel: kallsyms: parameters checking, for EXPORT_SYMBOL_GPL functions Chen Gang
2013-04-10 6:57 ` Rusty Russell
2013-04-10 10:56 ` Chen Gang [this message]
2013-04-11 2:52 ` Rusty Russell
2013-04-11 4:27 ` Chen Gang
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=51654557.3000308@asianux.com \
--to=gang.chen@asianux.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=sboyd@codeaurora.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.