block: return NULL in blk_alloc_queue() on error

This patch fixes follwoing warning:

block/blk-core.c: In function ‘blk_alloc_queue’:
block/blk-core.c:558:10: warning: returning ‘int’ from a function with return type ‘struct request_queue *’ makes pointer from integer without a cast [-Wint-conversion]
   return -EINVAL;

Fixes: 3d745ea5b0 ("block: simplify queue allocation")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Chaitanya Kulkarni 2020-03-29 10:08:26 -06:00 committed by Jens Axboe
parent 130879f1ee
commit 654a3667df
1 changed files with 1 additions and 1 deletions

View File

@ -555,7 +555,7 @@ struct request_queue *blk_alloc_queue(make_request_fn make_request, int node_id)
struct request_queue *q; struct request_queue *q;
if (WARN_ON_ONCE(!make_request)) if (WARN_ON_ONCE(!make_request))
return -EINVAL; return NULL;
q = __blk_alloc_queue(node_id); q = __blk_alloc_queue(node_id);
if (!q) if (!q)