summaryrefslogtreecommitdiff
path: root/sound/core/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/init.c')
-rw-r--r--sound/core/init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index 2f1bd9cbdbed..0c316189e947 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -363,6 +363,11 @@ static int snd_card_init(struct snd_card *card, struct device *parent,
card->debugfs_root = debugfs_create_dir(dev_name(&card->card_dev),
sound_debugfs_root);
#endif
+#ifdef CONFIG_SND_CTL_DEBUG
+ card->value_buf = kmalloc(sizeof(*card->value_buf), GFP_KERNEL);
+ if (!card->value_buf)
+ return -ENOMEM;
+#endif
return 0;
__error_ctl:
@@ -587,6 +592,9 @@ static int snd_card_do_free(struct snd_card *card)
snd_device_free_all(card);
if (card->private_free)
card->private_free(card);
+#ifdef CONFIG_SND_CTL_DEBUG
+ kfree(card->value_buf);
+#endif
if (snd_info_card_free(card) < 0) {
dev_warn(card->dev, "unable to free card info\n");
/* Not fatal error */