Re: [PATCH 1/6] staging: most: sound: create one sound card w/ multiple PCM devices per MOST device

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

 



On Wed, Dec 12, 2018 at 01:15:26PM +0100, Christian Gromm wrote:
> @@ -571,6 +600,40 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
>  		return -EINVAL;
>  	}
>  
> +	ret = split_arg_list(arg_list, &card_name, &ch_num, &sample_res,
> +			     &create);
> +	if (ret < 0)
> +		return ret;
> +
> +	list_for_each_entry(adpt, &adpt_list, list) {
> +		if (adpt->iface == iface && adpt->registered)
> +			return -ENOSPC;
> +		if (!adpt->registered) {
> +			adpt->pcm_dev_idx++;
> +			goto skip_adpt_alloc;

We haven't ensured the adpt->iface == iface.

> +		}
> +	}

Probably you want to say:

	list_for_each_entry(adpt, &adpt_list, list) {
		if (adpt->iface != iface)
			continue;
		if (adpt->registered)
			return -ENOSPC;
		adpt->pcm_dev_idx++;
		goto skip_adpt_alloc;
	}

But here again, I think I might prefer if allocating a new "adpt" were
and explicit command from user space as opposed to just a side effect of
registering a new iface.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux