Skip to content

Commit

Permalink
nbd: Return error code directly
Browse files Browse the repository at this point in the history
By returning the error code directly, we can avoid the jump label
error_out.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Markus Pargmann authored and Jens Axboe committed Apr 2, 2015
1 parent e018e75 commit dab5313
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req)
if (result <= 0) {
dev_err(disk_to_dev(nbd->disk),
"Send control failed (result %d)\n", result);
goto error_out;
return -EIO;
}

if (nbd_cmd(req) == NBD_CMD_WRITE) {
Expand All @@ -270,14 +270,11 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req)
dev_err(disk_to_dev(nbd->disk),
"Send data failed (result %d)\n",
result);
goto error_out;
return -EIO;
}
}
}
return 0;

error_out:
return -EIO;
}

static struct request *nbd_find_request(struct nbd_device *nbd,
Expand Down

0 comments on commit dab5313

Please sign in to comment.