]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
nbd: Return error pointer directly
authorMarkus Pargmann <mpa@pengutronix.de>
Thu, 2 Apr 2015 08:11:41 +0000 (10:11 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 2 Apr 2015 18:39:28 +0000 (12:39 -0600)
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 54bf633c90135b92e57d41767256118f516c223e..39e5f7fae3efb76ab888ec19b2b8a8fdb4b258b4 100644 (file)
@@ -285,7 +285,7 @@ static struct request *nbd_find_request(struct nbd_device *nbd,
 
        err = wait_event_interruptible(nbd->active_wq, nbd->active_req != xreq);
        if (unlikely(err))
-               goto out;
+               return ERR_PTR(err);
 
        spin_lock(&nbd->queue_lock);
        list_for_each_entry_safe(req, tmp, &nbd->queue_head, queuelist) {
@@ -297,10 +297,7 @@ static struct request *nbd_find_request(struct nbd_device *nbd,
        }
        spin_unlock(&nbd->queue_lock);
 
-       err = -ENOENT;
-
-out:
-       return ERR_PTR(err);
+       return ERR_PTR(-ENOENT);
 }
 
 static inline int sock_recv_bvec(struct nbd_device *nbd, struct bio_vec *bvec)