提交 dab5313a 编写于 作者: M Markus Pargmann 提交者: Jens Axboe

nbd: Return error code directly

By returning the error code directly, we can avoid the jump label
error_out.
Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
Acked-by: NPavel Machek <pavel@ucw.cz>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 e018e757
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册