Skip to content

Commit ec9e96b

Browse files
Amit EngelChristoph Hellwig
authored andcommitted
nvme-fabrics: parse nvme connect Linux error codes
This fixes the assumption that errval is an unsigned nvme error Signed-off-by: Amit Engel <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 14446f9 commit ec9e96b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/nvme/host/fabrics.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
270270
{
271271
int err_sctype = errval & ~NVME_SC_DNR;
272272

273+
if (errval < 0) {
274+
dev_err(ctrl->device,
275+
"Connect command failed, errno: %d\n", errval);
276+
return;
277+
}
278+
273279
switch (err_sctype) {
274280
case NVME_SC_CONNECT_INVALID_PARAM:
275281
if (offset >> 16) {

0 commit comments

Comments
 (0)