Skip to content

Commit

Permalink
NVMe: Set result from user admin command
Browse files Browse the repository at this point in the history
The ioctl data structure includes space for the 'result' of the admin
command to be returned; it just wasn't filled in.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
  • Loading branch information
Keith Busch authored and Matthew Wilcox committed Nov 13, 2012
1 parent 3295874 commit f4f117f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,12 +1237,17 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev,
if (length != cmd.data_len)
status = -ENOMEM;
else
status = nvme_submit_admin_cmd(dev, &c, NULL);
status = nvme_submit_admin_cmd(dev, &c, &cmd.result);

if (cmd.data_len) {
nvme_unmap_user_pages(dev, cmd.opcode & 1, iod);
nvme_free_iod(dev, iod);
}

if (!status && copy_to_user(&ucmd->result, &cmd.result,
sizeof(cmd.result)))
status = -EFAULT;

return status;
}

Expand Down

0 comments on commit f4f117f

Please sign in to comment.