ALSA: compress: Pass through return value of open ops callback
diff mbox

Message ID 1395233979-7675-1-git-send-email-ckeepax@opensource.wolfsonmicro.com
State Accepted
Headers show

Commit Message

Charles Keepax March 19, 2014, 12:59 p.m. UTC
The snd_compr_open function would always return 0 even if the compressed
ops open function failed, obviously this is incorrect. Looks like this
was introduced by a small typo in:

commit a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85
ALSA: Add a reference counter to card instance

This patch returns the value from the compressed op as it should.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 sound/core/compress_offload.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Vinod Koul March 19, 2014, 2:36 p.m. UTC | #1
On Wed, Mar 19, 2014 at 12:59:39PM +0000, Charles Keepax wrote:
> The snd_compr_open function would always return 0 even if the compressed
> ops open function failed, obviously this is incorrect. Looks like this
> was introduced by a small typo in:
> 
> commit a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85
> ALSA: Add a reference counter to card instance
> 
> This patch returns the value from the compressed op as it should.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Acked-by: Vinod Koul <vinod.koul@intel..com>
Takashi Iwai March 19, 2014, 2:47 p.m. UTC | #2
At Wed, 19 Mar 2014 12:59:39 +0000,
Charles Keepax wrote:
> 
> The snd_compr_open function would always return 0 even if the compressed
> ops open function failed, obviously this is incorrect. Looks like this
> was introduced by a small typo in:
> 
> commit a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85
> ALSA: Add a reference counter to card instance
> 
> This patch returns the value from the compressed op as it should.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Applied with ack by Vinod.  I added Cc to stable.


thanks,

Takashi

> ---
>  sound/core/compress_offload.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
> index 7a20897..7403f34 100644
> --- a/sound/core/compress_offload.c
> +++ b/sound/core/compress_offload.c
> @@ -133,7 +133,7 @@ static int snd_compr_open(struct inode *inode, struct file *f)
>  		kfree(data);
>  	}
>  	snd_card_unref(compr->card);
> -	return 0;
> +	return ret;
>  }
>  
>  static int snd_compr_free(struct inode *inode, struct file *f)
> -- 
> 1.7.2.5
>

Patch
diff mbox

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 7a20897..7403f34 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -133,7 +133,7 @@  static int snd_compr_open(struct inode *inode, struct file *f)
 		kfree(data);
 	}
 	snd_card_unref(compr->card);
-	return 0;
+	return ret;
 }
 
 static int snd_compr_free(struct inode *inode, struct file *f)