* [PATCH] NVMe: Set result from user admin command
@ 2012-09-21 16:49 Keith Busch
2012-11-06 16:45 ` Matthew Wilcox
0 siblings, 1 reply; 2+ messages in thread
From: Keith Busch @ 2012-09-21 16:49 UTC (permalink / raw)
Signed-off-by: Keith Busch <keith.busch at intel.com>
---
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 f9ad514..c64ef67 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -1235,12 +1235,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;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-06 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-21 16:49 [PATCH] NVMe: Set result from user admin command Keith Busch
2012-11-06 16:45 ` Matthew Wilcox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).