diff --git a/fs/char_dev.c b/fs/char_dev.c index d0655ca894816cf74b31730309ad2cf357f6d6a0..f1f3bb8127997bddfb809d02353ee36774c01ae0 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -332,7 +332,7 @@ static struct kobject *cdev_get(struct cdev *p) if (owner && !try_module_get(owner)) return NULL; - kobj = kobject_get(&p->kobj); + kobj = kobject_get_unless_zero(&p->kobj); if (!kobj) module_put(owner); return kobj;