Skip to content

Commit 654a366

Browse files
ChaitanayaKulkarniaxboe
authored andcommitted
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: 3d745ea ("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>
1 parent 130879f commit 654a366

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎block/blk-core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ struct request_queue *blk_alloc_queue(make_request_fn make_request, int node_id)
555555
struct request_queue *q;
556556

557557
if (WARN_ON_ONCE(!make_request))
558-
return -EINVAL;
558+
return NULL;
559559

560560
q = __blk_alloc_queue(node_id);
561561
if (!q)

0 commit comments

Comments
 (0)