ChangeSet 1.1505, 2004/01/19 16:57:07-08:00, greg@kroah.com

[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.


 lib/kobject.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/lib/kobject.c b/lib/kobject.c
--- a/lib/kobject.c	Mon Jan 19 17:04:40 2004
+++ b/lib/kobject.c	Mon Jan 19 17:04:40 2004
@@ -547,7 +547,7 @@
 	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;
 		}
