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

nbd: Return error pointer directly

Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
Acked-by: NPavel Machek <pavel@ucw.cz>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 dab5313a
...@@ -285,7 +285,7 @@ static struct request *nbd_find_request(struct nbd_device *nbd, ...@@ -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); err = wait_event_interruptible(nbd->active_wq, nbd->active_req != xreq);
if (unlikely(err)) if (unlikely(err))
goto out; return ERR_PTR(err);
spin_lock(&nbd->queue_lock); spin_lock(&nbd->queue_lock);
list_for_each_entry_safe(req, tmp, &nbd->queue_head, queuelist) { 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, ...@@ -297,10 +297,7 @@ static struct request *nbd_find_request(struct nbd_device *nbd,
} }
spin_unlock(&nbd->queue_lock); spin_unlock(&nbd->queue_lock);
err = -ENOENT; return ERR_PTR(-ENOENT);
out:
return ERR_PTR(err);
} }
static inline int sock_recv_bvec(struct nbd_device *nbd, struct bio_vec *bvec) static inline int sock_recv_bvec(struct nbd_device *nbd, struct bio_vec *bvec)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册