Documentation states that the NVMe status code should be returned,
to fix up the code to actually do it.
Signed-off-by: Hannes Reinecke <hare@suse.de>
{
__u32 cdw12 = NVME_SET(dtype, DIRECTIVE_SEND_IDENTIFY_CDW12_DTYPE) |
NVME_SET(endir, DIRECTIVE_SEND_IDENTIFY_CDW12_ENDIR);
+ __u32 result = 0;
+ int err;
struct nvme_directive_send_args args = {
.args_size = sizeof(args),
.fd = fd,
.data_len = sizeof(*id),
.data = id,
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
- .result = NULL,
+ .result = &result,
};
- return nvme_directive_send(&args);
+ err = nvme_directive_send(&args);
+ if (err && result)
+ err = result;
+ return err;
}
int nvme_directive_recv(struct nvme_directive_recv_args *args)