Re: [PATCH] soc: soc-core: fix a missing check on list iterator

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

 



Hi Xiaomeng

Thank you for your patch

> The bug is here:
> 	*dai_name = dai->driver->name;
> 
> For for_each_component_dais, just like list_for_each_entry,
> the list iterator 'dai' will point to a bogus position
> containing HEAD if the list is empty or no element is found.
> This case must be checked before any use of the iterator,
> otherwise it will lead to a invalid memory access.
> 
> To fix the bug, use a new variable 'iter' as the list iterator,
> while use the original variable 'dai' as a dedicated pointer
> to point to the found element.
> 
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 58bf4179000a3 ("ASoC: soc-core: remove dai_drv from snd_soc_component")
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@xxxxxxxxx>
> ---


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux