Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20017
b: refs/heads/master
c: b365b3d
h: refs/heads/master
i:
  20015: f21df95
v: v3
  • Loading branch information
Chuck Ebbert authored and Greg Kroah-Hartman committed Feb 6, 2006
1 parent b4b0480 commit 978d6f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c171fef5c8566cf5f57877e7832fa696ecdf5228
refs/heads/master: b365b3daf2a9e2a8b002ea9fef877af1c71513fd
4 changes: 4 additions & 0 deletions trunk/lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ static int get_kobj_path_length(struct kobject *kobj)
* 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);
Expand Down Expand Up @@ -107,6 +109,8 @@ char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask)
int len;

len = get_kobj_path_length(kobj);
if (len == 0)
return NULL;
path = kmalloc(len, gfp_mask);
if (!path)
return NULL;
Expand Down

0 comments on commit 978d6f5

Please sign in to comment.