We're about to relax some alignment requirements in the generic
(internal) nvme_mi_submit function. To ensure that the raw admin
interface continues to enfore the required alignment on DOFST and DLEN
fields, implement checks in the Admin command interface.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
return -1;
}
- /* must be aligned */
- if (resp_data_offset & 0x3) {
+ /* request and response lengths & offset must be aligned */
+ if ((req_data_size & 0x3) ||
+ (*resp_data_size & 0x3) ||
+ (resp_data_offset & 0x3)) {
errno = EINVAL;
return -1;
}