aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/samples/kobject/ssh:/git@git.zx2c4.com
diff options
context:
space:
mode:
authorMaoyi Xie <maoyixie.tju@gmail.com>2026-05-19 03:40:22 +0800
committerTakashi Iwai <tiwai@suse.de>2026-05-19 07:38:54 +0200
commit34ed2395613b23f8645e320abdcab6d688dc7a80 (patch)
tree408cf55bee7e5329205fc6756ff73e66bba922c2 /samples/kobject/ssh:/git@git.zx2c4.com
parentALSA: hda/realtek: Add quirk for HP Z66 G6 14 laptop (diff)
ALSA: timer: avoid past-the-end iterator in snd_timer_dev_register()
snd_timer_dev_register() walks snd_timer_list looking for the ordered insertion point and on loop fall-through passes &timer1->device_list to list_add_tail(): list_for_each_entry(timer1, &snd_timer_list, device_list) { ... break; /* on found-position */ ... } list_add_tail(&timer->device_list, &timer1->device_list); When the loop walks all entries without break, timer1 is past-the-end. &timer1->device_list aliases &snd_timer_list (the list head) via container_of offset cancellation, so the insert lands at the list tail. That is the intended behaviour, but the access is undefined per C11 even though it works in practice. Track an explicit insert_before pointer initialised to the list head and overwritten to &timer1->device_list only when the loop breaks early. The observable behaviour is unchanged. Fixes: 9244b2c3079f ("[ALSA] alsa core: convert to list_for_each_entry*") Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com> Link: https://patch.msgid.link/20260518194023.1667857-2-maoyixie.tju@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'samples/kobject/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions