Re: [PATCH v7 1/2] nvme: add per-queue sysfs directories
From: Daniel Wagner
Date: Wed Nov 04 2026 - 12:48:48 EST
On Wed, Nov 04, 2026 at 06:06:29AM -0800, Saravanan D wrote:
> +struct nvme_queue_info *
> +nvme_add_queue_info(struct nvme_ctrl *ctrl, unsigned int qid, void *data)
> +{
> + struct nvme_queue_info *qinfo;
> + int ret;
> +
> + if (WARN_ON_ONCE(!ctrl->queues_kobj))
> + return ERR_PTR(-EINVAL);
> +
> + qinfo = kzalloc_obj(*qinfo);
> + if (!qinfo)
> + return ERR_PTR(-ENOMEM);
> + qinfo->data = data;
> +
> + ret = kobject_init_and_add(&qinfo->kobj, &nvme_queue_info_ktype,
> + ctrl->queues_kobj, "%u", qid);
> + if (ret)
> + goto out_put;
> +
> + ret = sysfs_create_groups(&qinfo->kobj, ctrl->ops->queue_attr_groups);
> + if (ret)
> + goto out_put;
Don't you have to call kobject_del(&qinfo->kobj); here?