Messages in this thread Patch in this message | | | Subject | [PATCH 1/4][Trivial] lib/kobject.c: Check parameter in kobject_get_path | From | yan <> | Date | Sat, 21 Apr 2012 17:25:42 +0800 |
| |
kobject_get_path is exported, it passes its parameter kobj to get_kobj_path_length and fill_kobj_path which are both static and called only once here. So check this parameter.
Signed-off-by: Yan Hong <clouds.yan@gmail.com> --- lib/kobject.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/kobject.c b/lib/kobject.c index 38fcc60..56c8cb3 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -104,6 +104,9 @@ char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask) char *path; int len; + if (!kobj) + return NULL; + len = get_kobj_path_length(kobj); if (len == 0) return NULL; -- 1.7.5.1
| |