diff options
author | 2017-05-22 16:32:40 +1000 | |
---|---|---|
committer | 2017-05-22 16:32:40 +1000 | |
commit | d68c51e0b377838dd31b37707813bb62089f399c (patch) | |
tree | 4557d5ced33ea6da60bc84ee288af9924192f046 /lib/kobject.c | |
parent | security: Grammar s/allocates/allocated/ (diff) | |
parent | Linux 4.12-rc2 (diff) | |
download | wireguard-linux-d68c51e0b377838dd31b37707813bb62089f399c.tar.xz wireguard-linux-d68c51e0b377838dd31b37707813bb62089f399c.zip |
Sync to mainline for security submaintainers to work against
Diffstat (limited to 'lib/kobject.c')
-rw-r--r-- | lib/kobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 445dcaeb0f56..763d70a18941 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -601,12 +601,15 @@ struct kobject *kobject_get(struct kobject *kobj) } EXPORT_SYMBOL(kobject_get); -static struct kobject * __must_check kobject_get_unless_zero(struct kobject *kobj) +struct kobject * __must_check kobject_get_unless_zero(struct kobject *kobj) { + if (!kobj) + return NULL; if (!kref_get_unless_zero(&kobj->kref)) kobj = NULL; return kobj; } +EXPORT_SYMBOL(kobject_get_unless_zero); /* * kobject_cleanup - free kobject resources. |