[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120423203824.GA13075@kroah.com>
Date: Mon, 23 Apr 2012 13:38:24 -0700
From: greg <gregkh@...uxfoundation.org>
To: yan <clouds.yan@...il.com>
Cc: kernel <linux-kernel@...r.kernel.org>,
message <message.get@...il.com>
Subject: Re: [PATCH 1/4][Trivial] lib/kobject.c: Check parameter in
kobject_get_path
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
--
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