Skip to content

Commit

Permalink
nbd: Return error pointer directly
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Markus Pargmann authored and Jens Axboe committed Apr 2, 2015
1 parent dab5313 commit de9ad6d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit de9ad6d

Please sign in to comment.