* [PATCH] ALSA: firewire: fix error return code in scs_probe()
@ 2013-06-18 13:09 Wei Yongjun
2013-06-18 14:02 ` Clemens Ladisch
2013-06-18 14:17 ` Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: Wei Yongjun @ 2013-06-18 13:09 UTC (permalink / raw)
To: clemens, perex, tiwai; +Cc: yongjun_wei, alsa-devel, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Fix to return -ENOMEM in the kmalloc() error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
sound/firewire/scs1x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/firewire/scs1x.c b/sound/firewire/scs1x.c
index 844a555..b252c21 100644
--- a/sound/firewire/scs1x.c
+++ b/sound/firewire/scs1x.c
@@ -405,8 +405,10 @@ static int scs_probe(struct device *unit_dev)
scs->output_idle = true;
scs->buffer = kmalloc(HSS1394_MAX_PACKET_SIZE, GFP_KERNEL);
- if (!scs->buffer)
+ if (!scs->buffer) {
+ err = -ENOMEM;
goto err_card;
+ }
scs->hss_handler.length = HSS1394_MAX_PACKET_SIZE;
scs->hss_handler.address_callback = handle_hss;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: firewire: fix error return code in scs_probe()
2013-06-18 13:09 [PATCH] ALSA: firewire: fix error return code in scs_probe() Wei Yongjun
@ 2013-06-18 14:02 ` Clemens Ladisch
2013-06-18 14:17 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Clemens Ladisch @ 2013-06-18 14:02 UTC (permalink / raw)
To: Takashi Iwai; +Cc: yongjun_wei, Wei Yongjun, alsa-devel, linux-kernel
Wei Yongjun wrote:
> Fix to return -ENOMEM in the kmalloc() error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
> scs->buffer = kmalloc(HSS1394_MAX_PACKET_SIZE, GFP_KERNEL);
> - if (!scs->buffer)
> + if (!scs->buffer) {
> + err = -ENOMEM;
> goto err_card;
> + }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: firewire: fix error return code in scs_probe()
@ 2013-06-18 14:02 ` Clemens Ladisch
0 siblings, 0 replies; 4+ messages in thread
From: Clemens Ladisch @ 2013-06-18 14:02 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Wei Yongjun, yongjun_wei, alsa-devel, linux-kernel
Wei Yongjun wrote:
> Fix to return -ENOMEM in the kmalloc() error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
> scs->buffer = kmalloc(HSS1394_MAX_PACKET_SIZE, GFP_KERNEL);
> - if (!scs->buffer)
> + if (!scs->buffer) {
> + err = -ENOMEM;
> goto err_card;
> + }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: firewire: fix error return code in scs_probe()
2013-06-18 13:09 [PATCH] ALSA: firewire: fix error return code in scs_probe() Wei Yongjun
2013-06-18 14:02 ` Clemens Ladisch
@ 2013-06-18 14:17 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2013-06-18 14:17 UTC (permalink / raw)
To: Wei Yongjun; +Cc: clemens, perex, yongjun_wei, alsa-devel, linux-kernel
At Tue, 18 Jun 2013 21:09:42 +0800,
Wei Yongjun wrote:
>
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return -ENOMEM in the kmalloc() error handling
> case instead of 0, as done elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Thanks, applied with ack by Clemens.
Takashi
> ---
> sound/firewire/scs1x.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sound/firewire/scs1x.c b/sound/firewire/scs1x.c
> index 844a555..b252c21 100644
> --- a/sound/firewire/scs1x.c
> +++ b/sound/firewire/scs1x.c
> @@ -405,8 +405,10 @@ static int scs_probe(struct device *unit_dev)
> scs->output_idle = true;
>
> scs->buffer = kmalloc(HSS1394_MAX_PACKET_SIZE, GFP_KERNEL);
> - if (!scs->buffer)
> + if (!scs->buffer) {
> + err = -ENOMEM;
> goto err_card;
> + }
>
> scs->hss_handler.length = HSS1394_MAX_PACKET_SIZE;
> scs->hss_handler.address_callback = handle_hss;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-06-18 14:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 13:09 [PATCH] ALSA: firewire: fix error return code in scs_probe() Wei Yongjun
2013-06-18 14:02 ` Clemens Ladisch
2013-06-18 14:02 ` Clemens Ladisch
2013-06-18 14:17 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.