diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-06 10:03:29 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-11-06 10:03:29 +0100 |
commit | 70324494b6f283311c5339fb1795fdec2d8850d9 (patch) | |
tree | 5a318c2b60ba6e7861d630310d1930f62b8893ce /sound/core/compress_offload.c | |
parent | 73b5301b02c8d3456a5ea64c9ed9802a4a376af6 (diff) | |
parent | e47a682ace0cd56eb8e09b806c2b0f034b491520 (diff) | |
download | blackbird-obmc-linux-70324494b6f283311c5339fb1795fdec2d8850d9.tar.gz blackbird-obmc-linux-70324494b6f283311c5339fb1795fdec2d8850d9.zip |
Merge branch 'spi-linus' into spi-next
Diffstat (limited to 'sound/core/compress_offload.c')
-rw-r--r-- | sound/core/compress_offload.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index c40ae573346d..ad11dc994792 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -100,12 +100,15 @@ static int snd_compr_open(struct inode *inode, struct file *f) if (dirn != compr->direction) { pr_err("this device doesn't support this direction\n"); + snd_card_unref(compr->card); return -EINVAL; } data = kzalloc(sizeof(*data), GFP_KERNEL); - if (!data) + if (!data) { + snd_card_unref(compr->card); return -ENOMEM; + } data->stream.ops = compr->ops; data->stream.direction = dirn; data->stream.private_data = compr->private_data; @@ -113,6 +116,7 @@ static int snd_compr_open(struct inode *inode, struct file *f) runtime = kzalloc(sizeof(*runtime), GFP_KERNEL); if (!runtime) { kfree(data); + snd_card_unref(compr->card); return -ENOMEM; } runtime->state = SNDRV_PCM_STATE_OPEN; @@ -126,7 +130,8 @@ static int snd_compr_open(struct inode *inode, struct file *f) kfree(runtime); kfree(data); } - return ret; + snd_card_unref(compr->card); + return 0; } static int snd_compr_free(struct inode *inode, struct file *f) |