[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1335000692.2188.10.camel@yan>
Date: Sat, 21 Apr 2012 17:31:24 +0800
From: yan <clouds.yan@...il.com>
To: greg <gregkh@...uxfoundation.org>
Cc: kernel <linux-kernel@...r.kernel.org>,
message <message.get@...il.com>
Subject: [PATCH 2/4][Trivial] lib/kobject.c : Check parameter in
kobject_set_name
kobject_set_name is exported and is just a wrapper for kobject_set_name_vargs
which does not check its parameter kobj.
So check this parameter in kobject_set_name.
Signed-off-by: Yan Hong <clouds.yan@...il.com>
---
lib/kobject.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/kobject.c b/lib/kobject.c
index 56c8cb3..dd67855 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -248,6 +248,9 @@ int kobject_set_name(struct kobject *kobj, const char *fmt, ...)
va_list vargs;
int retval;
+ if (!kobj)
+ return -EINVAL;
+
va_start(vargs, fmt);
retval = kobject_set_name_vargs(kobj, fmt, vargs);
va_end(vargs);
--
1.7.5.1
--
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