Bart Van Assche <bvanassche@xxxxxxx> 于2019年4月2日周二 上午6:41写道: > > On Sun, 2019-03-31 at 23:28 +0800, weiping zhang wrote: > > On Tue, Jan 08, 2019 at 04:57:40PM -0800, Bart Van Assche wrote: > > > > @@ -942,6 +961,14 @@ int blk_register_queue(struct gendisk *disk) > > > > goto unlock; > > > > } > > > > > > > > + ret = sysfs_create_group(&q->kobj, &queue_attr_group); > > > > + if (ret) { > > > > + kobject_del(&q->kobj); > > > > + blk_trace_remove_sysfs(dev); > > > > + kobject_put(&dev->kobj); > > > > + goto unlock; > > > > + } > > > > > > Are you sure the "goto unlock" is OK here? Shouldn't kobject_del() be called > > > to undo the kobject_add() call if sysfs_create_group() fails? > > > > Sorry, can you tell me why it's may be not safe, if goto unlock here, > > if failed to call sysfs_create_group, I think we should call > > kobject_del. > > Can you address the other comments and repost your patch? I may have misread > your patch when I wrote the above comment. > Thanks Bart, I post v2 later. > Thanks, > > Bart.