Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de9ad6d4 authored by Markus Pargmann's avatar Markus Pargmann Committed by Jens Axboe
Browse files

nbd: Return error pointer directly



Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent dab5313a
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -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,
	}
	}
	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)