diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2015-04-02 10:11:40 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-04-02 12:39:26 -0600 |
commit | dab5313aa4e668d87253dd4289c816cb08f63e52 (patch) | |
tree | e364decf766a469bc66265401a5ab6f9c48d3532 /drivers/block | |
parent | e018e7570c8b0f9f5a4bb0e1eff9b1e7f768f49b (diff) |
nbd: Return error code directly
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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nbd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index ef57e7d83aed..54bf633c9013 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -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) { @@ -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, |