Message ID | 20170306163404.1238-12-jack@suse.cz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/block/genhd.c b/block/genhd.c index e8df37de03af..7fa59bc231dd 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1374,7 +1374,7 @@ struct kobject *get_disk(struct gendisk *disk) owner = disk->fops->owner; if (owner && !try_module_get(owner)) return NULL; - kobj = kobject_get(&disk_to_dev(disk)->kobj); + kobj = kobject_get_unless_zero(&disk_to_dev(disk)->kobj); if (kobj == NULL) { module_put(owner); return NULL;