From: yan <clouds.yan@gmail.com>
To: greg <gregkh@linuxfoundation.org>
Cc: kernel <linux-kernel@vger.kernel.org>, message <message.get@gmail.com>
Subject: [PATCH 1/4][Trivial] lib/kobject.c: Check parameter in kobject_get_path
Date: Sat, 21 Apr 2012 17:25:42 +0800 [thread overview]
Message-ID: <1335000350.2188.5.camel@yan> (raw)
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.
Signed-off-by: Yan Hong <clouds.yan@gmail.com>
---
lib/kobject.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/kobject.c b/lib/kobject.c
index 38fcc60..56c8cb3 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -104,6 +104,9 @@ char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask)
char *path;
int len;
+ if (!kobj)
+ return NULL;
+
len = get_kobj_path_length(kobj);
if (len == 0)
return NULL;
--
1.7.5.1
next reply other threads:[~2012-04-21 9:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-21 9:25 yan [this message]
2012-04-23 20:38 ` [PATCH 1/4][Trivial] lib/kobject.c: Check parameter in kobject_get_path greg
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=1335000350.2188.5.camel@yan \
--to=clouds.yan@gmail.com \
--cc=gregkh@linuxfoundation.org \
--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 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.