diff options
Diffstat (limited to 'ANDROID_3.4.5/sound/core/compress_offload.c')
-rw-r--r-- | ANDROID_3.4.5/sound/core/compress_offload.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ANDROID_3.4.5/sound/core/compress_offload.c b/ANDROID_3.4.5/sound/core/compress_offload.c index a68aed7f..a58cf359 100644 --- a/ANDROID_3.4.5/sound/core/compress_offload.c +++ b/ANDROID_3.4.5/sound/core/compress_offload.c @@ -102,12 +102,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; @@ -115,6 +118,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; @@ -128,7 +132,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) |