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
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to