Re: [PATCH v2 04/14] staging: most: sound: introduce new sound adapter management

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

 



On Thu, Mar 28, 2019 at 02:17:32PM +0100, Christian Gromm wrote:
> +static int audio_create_sound_card(void)
> +{
> +	int ret;
> +	struct sound_adapter *adpt;
> +
> +	list_for_each_entry(adpt, &adpt_list, list) {
> +		if (!adpt->registered)
> +			goto adpt_alloc;
> +	}
> +	return -ENODEV;
> +adpt_alloc:
> +	ret = snd_card_register(adpt->card);
> +	if (ret < 0) {
> +		release_adapter(adpt);

This doesn't feel right.  We didn't acquire "adpt" in this function so
why are we releasing it here.  Do we release it somewhere else as well?

It's still on the list...

> +		return ret;
> +	}
> +	adpt->registered = true;
> +	return ret;
> +}

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