aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2015-04-02 04:11:40 -0400
committerJens Axboe <axboe@fb.com>2015-04-02 14:39:26 -0400
commitdab5313aa4e668d87253dd4289c816cb08f63e52 (patch)
treee364decf766a469bc66265401a5ab6f9c48d3532
parente018e7570c8b0f9f5a4bb0e1eff9b1e7f768f49b (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>
-rw-r--r--drivers/block/nbd.c7
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)
249 if (result <= 0) { 249 if (result <= 0) {
250 dev_err(disk_to_dev(nbd->disk), 250 dev_err(disk_to_dev(nbd->disk),
251 "Send control failed (result %d)\n", result); 251 "Send control failed (result %d)\n", result);
252 goto error_out; 252 return -EIO;
253 } 253 }
254 254
255 if (nbd_cmd(req) == NBD_CMD_WRITE) { 255 if (nbd_cmd(req) == NBD_CMD_WRITE) {
@@ -270,14 +270,11 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req)
270 dev_err(disk_to_dev(nbd->disk), 270 dev_err(disk_to_dev(nbd->disk),
271 "Send data failed (result %d)\n", 271 "Send data failed (result %d)\n",
272 result); 272 result);
273 goto error_out; 273 return -EIO;
274 } 274 }
275 } 275 }
276 } 276 }
277 return 0; 277 return 0;
278
279error_out:
280 return -EIO;
281} 278}
282 279
283static struct request *nbd_find_request(struct nbd_device *nbd, 280static struct request *nbd_find_request(struct nbd_device *nbd,