diff options
author | Jens Axboe <axboe@fb.com> | 2017-04-07 12:46:11 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-07 12:46:11 -0600 |
commit | ba127856d458a4ab4dd32ac8a59f2673b194db99 (patch) | |
tree | bef9cdafc6fa90cca4e0a3b426c9c0e553197bfa /lib | |
parent | 977c637bdf133311ef887c12fa3ed8b3e5a4210b (diff) | |
parent | 710c785f80ace49049aef1a003c0b8b932a58af8 (diff) |
Merge branch 'for-4.12/block' into for-next
Diffstat (limited to 'lib')
-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. |