ALSA: 6fire: Fix double-free bug in usb6fire_fw_ezusb_upload()
authorJesper Juhl <jj@chaosbits.net>
Mon, 13 Jun 2011 21:52:02 +0000 (23:52 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 14 Jun 2011 05:27:26 +0000 (07:27 +0200)
We have a double-free bug in
sound/usb/6fire/firmware.c::usb6fire_fw_ezusb_upload().
We already call release_firmware(fw) on line 258, so when we then do it
again after usb6fire_fw_ezusb_write() returns <0, we have a double-free.
Easily fixed by just removing the last call to release_firmware().

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/6fire/firmware.c

index a91719d5918b69c6e76e577364c59f892f5768bd..1e3ae3327dd3a65431b4a517ab5b340dac2ee6f7 100644 (file)
@@ -270,7 +270,6 @@ static int usb6fire_fw_ezusb_upload(
        data = 0x00; /* resume ezusb cpu */
        ret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1);
        if (ret < 0) {
-               release_firmware(fw);
                snd_printk(KERN_ERR PREFIX "unable to upload ezusb "
                                "firmware %s: end message.\n", fwname);
                return ret;