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]     [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