Message ID | 20170323003702.27571-11-jack@suse.cz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/block/genhd.c b/block/genhd.c index a9c516a8b37d..510aac1486cb 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1352,7 +1352,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;