Re: [PATCH] block: return NULL in blk_alloc_queue() on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 28, 2020 at 11:42:17PM +0000, Chaitanya Kulkarni wrote:
> >> >@@ -555,7 +555,7 @@ struct request_queue *blk_alloc_queue(make_request_fn make_request, int node_id)
> >> >   	struct request_queue *q;
> >> >
> >> >   	if (WARN_ON_ONCE(!make_request))
> >> >-		return -EINVAL;
> >> >+		return NULL;
> > Maybe return ERR_PTR(-EINVAL) is better.
> >
> 
> Initially I used that, what if existing callers are reallying on
> NULL vs !NULL return value ? Use of NULL just makes the code
> consistent with existing return value.
> 
> If Jens is okay with ERR_PTR(), I'll send V2.

The callers can't handle an ERR_PTR, so v1 is correct.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux