aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2004-01-19 00:57:07 -0800
committerGreg Kroah-Hartman <greg@kroah.com>2004-01-19 00:57:07 -0800
commit5a8d6ecf62b3ef2a0cde434e9bfdd33b76c07496 (patch)
tree9ee023741f6cad505c899c7d72b1f194e305ece0 /lib
parent9f1257d71211e6eb138fe3e722147e1134524134 (diff)
downloadhistory-5a8d6ecf62b3ef2a0cde434e9bfdd33b76c07496.tar.gz
[PATCH] Kobject: prevent oops in kset_find_obj() if kobject_name() is NULL
Thanks to Hollis Blanchard <hollisb@us.ibm.com> for pointing this out.
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 8ab50700d2c2b9..5bc00c5b6ec363 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -547,7 +547,7 @@ struct kobject * kset_find_obj(struct kset * kset, const char * name)
down_read(&kset->subsys->rwsem);
list_for_each(entry,&kset->list) {
struct kobject * k = to_kobj(entry);
- if (!strcmp(kobject_name(k),name)) {
+ if (kobject_name(k) && (!strcmp(kobject_name(k),name))) {
ret = k;
break;
}