Commit 81f0c2ef authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: remove the extra gendisk reference in __blk_mq_register_dev

kobject_add already grabs a reference to the parent, no need to have
another one.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220628171850.1313069-5-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 4a8d14bb
...@@ -215,7 +215,6 @@ void blk_mq_unregister_dev(struct device *dev, struct request_queue *q) ...@@ -215,7 +215,6 @@ void blk_mq_unregister_dev(struct device *dev, struct request_queue *q)
kobject_uevent(q->mq_kobj, KOBJ_REMOVE); kobject_uevent(q->mq_kobj, KOBJ_REMOVE);
kobject_del(q->mq_kobj); kobject_del(q->mq_kobj);
kobject_put(&dev->kobj);
q->mq_sysfs_init_done = false; q->mq_sysfs_init_done = false;
} }
...@@ -261,7 +260,7 @@ int __blk_mq_register_dev(struct device *dev, struct request_queue *q) ...@@ -261,7 +260,7 @@ int __blk_mq_register_dev(struct device *dev, struct request_queue *q)
WARN_ON_ONCE(!q->kobj.parent); WARN_ON_ONCE(!q->kobj.parent);
lockdep_assert_held(&q->sysfs_dir_lock); lockdep_assert_held(&q->sysfs_dir_lock);
ret = kobject_add(q->mq_kobj, kobject_get(&dev->kobj), "%s", "mq"); ret = kobject_add(q->mq_kobj, &dev->kobj, "%s", "mq");
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -286,7 +285,6 @@ int __blk_mq_register_dev(struct device *dev, struct request_queue *q) ...@@ -286,7 +285,6 @@ int __blk_mq_register_dev(struct device *dev, struct request_queue *q)
kobject_uevent(q->mq_kobj, KOBJ_REMOVE); kobject_uevent(q->mq_kobj, KOBJ_REMOVE);
kobject_del(q->mq_kobj); kobject_del(q->mq_kobj);
kobject_put(&dev->kobj);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment