diff options
author | Keith Busch <keith.busch@intel.com> | 2012-09-21 12:49:05 -0400 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2012-11-13 09:13:49 -0500 |
commit | f4f117f64baf8840d22266d518227b2a186d294b (patch) | |
tree | 97ea3fb3af2c41e84fb091a343ff8c1925c46f4c /drivers/block | |
parent | 3295874b6074d749516d6decd43afad7bf6e38ff (diff) |
NVMe: Set result from user admin command
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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nvme.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index af88635e44e4..47c860454289 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
@@ -1237,12 +1237,17 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev, | |||
1237 | if (length != cmd.data_len) | 1237 | if (length != cmd.data_len) |
1238 | status = -ENOMEM; | 1238 | status = -ENOMEM; |
1239 | else | 1239 | else |
1240 | status = nvme_submit_admin_cmd(dev, &c, NULL); | 1240 | status = nvme_submit_admin_cmd(dev, &c, &cmd.result); |
1241 | 1241 | ||
1242 | if (cmd.data_len) { | 1242 | if (cmd.data_len) { |
1243 | nvme_unmap_user_pages(dev, cmd.opcode & 1, iod); | 1243 | nvme_unmap_user_pages(dev, cmd.opcode & 1, iod); |
1244 | nvme_free_iod(dev, iod); | 1244 | nvme_free_iod(dev, iod); |
1245 | } | 1245 | } |
1246 | |||
1247 | if (!status && copy_to_user(&ucmd->result, &cmd.result, | ||
1248 | sizeof(cmd.result))) | ||
1249 | status = -EFAULT; | ||
1250 | |||
1246 | return status; | 1251 | return status; |
1247 | } | 1252 | } |
1248 | 1253 | ||