diff --git a/src/nvme/mi.c b/src/nvme/mi.c index 82ed88a7..84d51b0c 100644 --- a/src/nvme/mi.c +++ b/src/nvme/mi.c @@ -433,7 +433,8 @@ int nvme_mi_submit(nvme_mi_ep_t ep, struct nvme_mi_req *req, rc = nvme_mi_verify_resp_mic(resp); if (rc) { nvme_msg(ep->root, LOG_WARNING, "crc mismatch\n"); - return rc; + errno = EBADMSG; + return -1; } } diff --git a/test/mi.c b/test/mi.c index a09c108b..a86ba155 100644 --- a/test/mi.c +++ b/test/mi.c @@ -306,7 +306,7 @@ static void test_invalid_crc(nvme_mi_ep_t ep) test_set_transport_callback(ep, test_invalid_crc_cb, NULL); rc = nvme_mi_mi_read_mi_data_subsys(ep, &ss_info); - assert(rc != 0); + assert(rc < 0); } /* test: test that the controller list populates the endpoint's list of