diff mbox series

[-next] ALSA: firewire-motu: fix error return code in snd_motu_stream_reserve_duplex()

Message ID 20210603143203.582017-1-yangyingliang@huawei.com
State Accepted
Commit ce9f50e7ac807b7651903c44f1b14a4f97725daa
Headers show
Series [-next] ALSA: firewire-motu: fix error return code in snd_motu_stream_reserve_duplex() | expand

Commit Message

Yang Yingliang June 3, 2021, 2:32 p.m. UTC
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: e50dfac81f73 ("ALSA: firewire-motu: cache event ticks in source packet header per data block")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 sound/firewire/motu/motu-stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Takashi Sakamoto June 3, 2021, 3:01 p.m. UTC | #1
Hi,

On Thu, Jun 03, 2021 at 10:32:03PM +0800, Yang Yingliang wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: e50dfac81f73 ("ALSA: firewire-motu: cache event ticks in source packet header per data block")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  sound/firewire/motu/motu-stream.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/firewire/motu/motu-stream.c b/sound/firewire/motu/motu-stream.c
> index 43ff5be32b15..9e6ca39ebd7f 100644
> --- a/sound/firewire/motu/motu-stream.c
> +++ b/sound/firewire/motu/motu-stream.c
> @@ -191,7 +191,7 @@ int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate,
>  		if (!motu->cache.event_offsets) {
>  			fw_iso_resources_free(&motu->tx_resources);
>  			fw_iso_resources_free(&motu->rx_resources);
> -			return err;
> +			return -ENOMEM;
>  		}
>  	}
>  
> -- 
> 2.25.1

Indeed. Nice to catch it.

Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>


Thanks

Takashi Sakamoto
Takashi Iwai June 4, 2021, 6:48 a.m. UTC | #2
On Thu, 03 Jun 2021 16:32:03 +0200,
Yang Yingliang wrote:
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: e50dfac81f73 ("ALSA: firewire-motu: cache event ticks in source packet header per data block")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Thanks, applied.


Takashi
diff mbox series

Patch

diff --git a/sound/firewire/motu/motu-stream.c b/sound/firewire/motu/motu-stream.c
index 43ff5be32b15..9e6ca39ebd7f 100644
--- a/sound/firewire/motu/motu-stream.c
+++ b/sound/firewire/motu/motu-stream.c
@@ -191,7 +191,7 @@  int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate,
 		if (!motu->cache.event_offsets) {
 			fw_iso_resources_free(&motu->tx_resources);
 			fw_iso_resources_free(&motu->rx_resources);
-			return err;
+			return -ENOMEM;
 		}
 	}