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

Signed-off-by: Markus Pargmann <[email protected]>
---
 drivers/block/nbd.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 3a3e0057e991..f2c1973c486a 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -244,7 +244,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) {
@@ -265,14 +265,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,
-- 
2.1.4


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to