[alsa-devel] inconsistent reference counting for snd-soc-skl

Takashi Sakamoto o-takashi at sakamocchi.jp
Thu Oct 13 15:54:43 CEST 2016


Hi,

On Oct 13 2016 22:41, Subhransu S. Prusty wrote:
> On Thu, Oct 13, 2016 at 10:19:37PM +0900, Takashi Sakamoto wrote:
>> Hi,
>>
>> I find an issue of snd-soc-skl due to inconsistent reference counting.
>> See this call graph.
>>
>> skl_probe()
>> ->skl_first_init()
>>   ->skl_i915_init()
>>     ->snd_hdac_display_power() (CONFIG_SND_SOC_HDAC_HDMI is enabled)
>>       ->bus->i915_power_refcount++
>> ->all error pathes
>>   ->skl_free()
>>     ->snd_hda_i915_exit()
>>       ->WARN_ON(!bus->i915_power_refcount)
>>
>> This might be also hit by rmmod(8). I see this bug in kernel 4.8 and
>> pre-4.9.
> 
> Thanks Takashi for reporting. We will fix this.

Thanks for the quick reply.

I'd like to correct the explanation. In last half of skl_probe(), the
reference count is decremented.
http://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/soc/intel/skylake/skl.c#n719

So this issue may occur on error paths between call of skl_first_init()
and the part.


Takashi Sakamoto


More information about the Alsa-devel mailing list