Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1512001 > unrolled thread

[PATCH] nbd: Fix error handling

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-10-30 05:30 +0100
Last post2016-10-30 05:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] nbd: Fix error handling Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-10-30 05:30 +0100

#1512001 — [PATCH] nbd: Fix error handling

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-10-30 05:30 +0100
Subject[PATCH] nbd: Fix error handling
Message-ID<sxPUR-89h-7@gated-at.bofh.it>
'blk_mq_alloc_request()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.

Fixes: 	fd8383fd88a2 ("nbd: convert to blkmq")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 19a16b2dbb91..7a1048755914 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -599,7 +599,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
 			return -EINVAL;
 
 		sreq = blk_mq_alloc_request(bdev_get_queue(bdev), WRITE, 0);
-		if (!sreq)
+		if (IS_ERR(sreq))
 			return -ENOMEM;
 
 		mutex_unlock(&nbd->tx_lock);
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web