From: Chuck Ebbert <76306.1226@compuserve.com> kobject_get_path() will oops if one of the component names is NULL. Fix that by returning NULL instead of oopsing. Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com> Cc: Greg KH Signed-off-by: Andrew Morton --- lib/kobject.c | 4 ++++ 1 files changed, 4 insertions(+) diff -puN lib/kobject.c~kobject-dont-oops-on-null-kobjectname lib/kobject.c --- 25/lib/kobject.c~kobject-dont-oops-on-null-kobjectname Fri Jan 13 14:24:45 2006 +++ 25-akpm/lib/kobject.c Fri Jan 13 14:24:45 2006 @@ -72,6 +72,8 @@ static int get_kobj_path_length(struct k * Add 1 to strlen for leading '/' of each level. */ do { + if (kobject_name(parent) == NULL) + return 0; length += strlen(kobject_name(parent)) + 1; parent = parent->parent; } while (parent); @@ -107,6 +109,8 @@ char *kobject_get_path(struct kobject *k int len; len = get_kobj_path_length(kobj); + if (len == 0) + return NULL; path = kmalloc(len, gfp_mask); if (!path) return NULL; _