public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: greg <gregkh@linuxfoundation.org>
To: yan <clouds.yan@gmail.com>
Cc: kernel <linux-kernel@vger.kernel.org>, message <message.get@gmail.com>
Subject: Re: [PATCH 1/4][Trivial] lib/kobject.c: Check parameter in kobject_get_path
Date: Mon, 23 Apr 2012 13:38:24 -0700	[thread overview]
Message-ID: <20120423203824.GA13075@kroah.com> (raw)
In-Reply-To: <1335000350.2188.5.camel@yan>

On Sat, Apr 21, 2012 at 05:25:42PM +0800, yan wrote:
> kobject_get_path is exported, it passes its parameter kobj to
> get_kobj_path_length and fill_kobj_path which are both static 
> and called only once here. So check this parameter.

Why?  If you call this function, you should pass in a valid pointer,
that's the proper way to call it.  No need to be "defensive" here at
all, if the caller messes up, then it crashes, as it should not be
making this type of call on a NULL pointer.

In looking at all of the in-kernel users of this function, they all do
this properly, so I see no need for this patch.

And these types of patches are not "trivial" at all, so please don't
mark them as such.

thanks,

greg k-h

      reply	other threads:[~2012-04-23 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21  9:25 [PATCH 1/4][Trivial] lib/kobject.c: Check parameter in kobject_get_path yan
2012-04-23 20:38 ` greg [this message]

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=20120423203824.GA13075@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=clouds.yan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=message.get@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox