Re: [PATCH 2/2] null_blk: fix ida error handling in null_add_dev()

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

 



On 15.07.22 10:12, Dan Carpenter wrote:
> -	nullb->index = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
> -	dev->index = nullb->index;
> +	rv = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
> +	if (rv < 0) {
> +		mutex_unlock(&lock);
> +		goto out_cleanup_zone;
> +	}
> +	nullb->index = rv;
> +	dev->index = rv;

Isn't ida_simple_get() deprecated? And actually the 'max' argument is 0 here,
so ida_alloc_range() tries to allocate a number between 0 and 0?




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux