Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dab5313a authored by Markus Pargmann's avatar Markus Pargmann Committed by Jens Axboe
Browse files

nbd: Return error code directly



By returning the error code directly, we can avoid the jump label
error_out.

Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent e018e757
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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,