nbd: Return error code directly
authorMarkus Pargmann <mpa@pengutronix.de>
Thu, 2 Apr 2015 08:11:40 +0000 (10:11 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 2 Apr 2015 18:39:26 +0000 (12:39 -0600)
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>
drivers/block/nbd.c

index ef57e7d83aeda1d7ba69194c07c4fc63a78ea117..54bf633c90135b92e57d41767256118f516c223e 100644 (file)
@@ -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,