diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-05-19 11:21:25 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-19 11:25:23 -0400 |
commit | 09cf03b80c593b08e8b630a145e14f485200b5af (patch) | |
tree | 21a5d5b26f68bf3a4076c76e29d9eb3dc47e1bc5 /sound/pci/hda/hda_codec.h | |
parent | c882246d840073a3dd0533ca164dfcbd7f6bd207 (diff) |
ALSA: hda - Fix possible races of accesses to connection list array
Like the previous fixes for cache hash accesses, a protection over
accesses to the widget connection list array must be provided.
Together with this action, remove snd_hda_get_conn_list() which can be
always race, and replace it with either snd_hda_get_num_conns() or
snd_hda_get_connections() calls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r-- | sound/pci/hda/hda_codec.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 29a311b05f2d..54b52819fb47 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -911,10 +911,13 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, | |||
911 | hda_nid_t *start_id); | 911 | hda_nid_t *start_id); |
912 | int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | 912 | int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, |
913 | hda_nid_t *conn_list, int max_conns); | 913 | hda_nid_t *conn_list, int max_conns); |
914 | static inline int | ||
915 | snd_hda_get_num_conns(struct hda_codec *codec, hda_nid_t nid) | ||
916 | { | ||
917 | return snd_hda_get_connections(codec, nid, NULL, 0); | ||
918 | } | ||
914 | int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid, | 919 | int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid, |
915 | hda_nid_t *conn_list, int max_conns); | 920 | hda_nid_t *conn_list, int max_conns); |
916 | int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid, | ||
917 | const hda_nid_t **listp); | ||
918 | int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums, | 921 | int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums, |
919 | const hda_nid_t *list); | 922 | const hda_nid_t *list); |
920 | int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux, | 923 | int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux, |