mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
nbd: Fix error handling
'blk_mq_alloc_request()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.
Fixes: fd8383fd88 ("nbd: convert to blkmq")
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
bc33b0ca11
commit
772918524d
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue