ALSA: firewire: fix error return code in scs_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 18 Jun 2013 13:09:42 +0000 (21:09 +0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 Jun 2013 14:11:57 +0000 (16:11 +0200)
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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/scs1x.c

index 844a555c3b1eb4ab002eb1c33b64f4703f6a3a44..b252c21b6d13b32d1fbc16a4d9894b6995d2dbf0 100644 (file)
@@ -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;