summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-05-19 17:21:25 +0200
committerTakashi Iwai <tiwai@suse.de>2012-05-19 17:25:23 +0200
commit09cf03b80c593b08e8b630a145e14f485200b5af (patch)
tree21a5d5b26f68bf3a4076c76e29d9eb3dc47e1bc5 /sound/pci/hda/hda_codec.h
parentALSA: hda/idt - Cache the power-map bits (diff)
downloadlinux-09cf03b80c593b08e8b630a145e14f485200b5af.tar.xz
linux-09cf03b80c593b08e8b630a145e14f485200b5af.zip
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.h7
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,
hda_nid_t *start_id);
int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
hda_nid_t *conn_list, int max_conns);
+static inline int
+snd_hda_get_num_conns(struct hda_codec *codec, hda_nid_t nid)
+{
+ return snd_hda_get_connections(codec, nid, NULL, 0);
+}
int snd_hda_get_raw_connections(struct hda_codec *codec, hda_nid_t nid,
hda_nid_t *conn_list, int max_conns);
-int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid,
- const hda_nid_t **listp);
int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums,
const hda_nid_t *list);
int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,