[PATCH] nvme: initialize identify ns data to NULL

Sagi Grimberg sagi at grimberg.me
Tue Mar 26 01:20:57 PDT 2024



On 25/03/2024 17:45, Tokunori Ikegami wrote:
> Currently nvme_identify_ns() sets the data to NULL if failed.

Where? Nothing sets id to NULL in nvme_identify_n(), what am I missing?
> Also the data is not freed if the function returned failure.

Where? I think you may be looking at a different code base?

--
int nvme_identify_ns(struct nvme_ctrl *ctrl, unsigned nsid,
                         struct nvme_id_ns **id)
{
         ....
         error = nvme_submit_sync_cmd(ctrl->admin_q, &c, *id, sizeof(**id));
         if (error) {
                 dev_warn(ctrl->device, "Identify namespace failed 
(%d)\n", error);
                 kfree(*id);
         }
         return error;
}

I don't see how this patch makes sense...



More information about the Linux-nvme mailing list