]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ALSA: control: Annotate snd_kcontrol with __counted_by()
authorTakashi Iwai <tiwai@suse.de>
Fri, 26 Jul 2024 15:28:15 +0000 (17:28 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 30 Jul 2024 05:45:37 +0000 (07:45 +0200)
commit4e9652003bc39032c3ab79e607aa3d1913c7cf57
treeabd0c6953ce30d7639fc33dce9139e6cb23e26c2
parent3c0e1ed9c87877d064c705a60db5fdb31a91e985
ALSA: control: Annotate snd_kcontrol with __counted_by()

struct snd_kcontrol contains a flex array of snd_kcontrol_volatile
objects at its end, and the array size is stored in count field.
This can be annotated gracefully with __counted_by() for catching
possible array overflows.

One additional change is the order of the count field initialization;
The assignment of the count field is moved before assignment of vd[]
elements for avoiding false-positive warnings from compilers.

Link: https://patch.msgid.link/20240726152840.8629-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/control.h
sound/core/control.c