aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 744a4b102c7f..7ce6dc138e90 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -111,10 +111,9 @@ char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask)
111 len = get_kobj_path_length(kobj); 111 len = get_kobj_path_length(kobj);
112 if (len == 0) 112 if (len == 0)
113 return NULL; 113 return NULL;
114 path = kmalloc(len, gfp_mask); 114 path = kzalloc(len, gfp_mask);
115 if (!path) 115 if (!path)
116 return NULL; 116 return NULL;
117 memset(path, 0x00, len);
118 fill_kobj_path(kobj, path, len); 117 fill_kobj_path(kobj, path, len);
119 118
120 return path; 119 return path;