summaryrefslogtreecommitdiff
path: root/sound/hda/core/ext
diff options
context:
space:
mode:
Diffstat (limited to 'sound/hda/core/ext')
-rw-r--r--sound/hda/core/ext/controller.c4
-rw-r--r--sound/hda/core/ext/stream.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/sound/hda/core/ext/controller.c b/sound/hda/core/ext/controller.c
index b1f1eff1d181..6d0af7e6f63c 100644
--- a/sound/hda/core/ext/controller.c
+++ b/sound/hda/core/ext/controller.c
@@ -90,8 +90,10 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus)
for (idx = 0; idx < link_count; idx++) {
hlink = kzalloc_obj(*hlink);
- if (!hlink)
+ if (!hlink) {
+ snd_hdac_ext_link_free_all(bus);
return -ENOMEM;
+ }
hlink->index = idx;
hlink->bus = bus;
hlink->ml_addr = bus->mlcap + AZX_ML_BASE +
diff --git a/sound/hda/core/ext/stream.c b/sound/hda/core/ext/stream.c
index 517bd151fcc3..1f96e0484660 100644
--- a/sound/hda/core/ext/stream.c
+++ b/sound/hda/core/ext/stream.c
@@ -102,8 +102,10 @@ int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
for (i = 0; i < num_stream; i++) {
struct hdac_ext_stream *hext_stream = kzalloc_obj(*hext_stream);
- if (!hext_stream)
+ if (!hext_stream) {
+ snd_hdac_ext_stream_free_all(bus);
return -ENOMEM;
+ }
tag = ++stream_tag;
snd_hdac_ext_stream_init(bus, hext_stream, idx, dir, tag);
idx++;
@@ -111,7 +113,6 @@ int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
}
return 0;
-
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_init_all);