OSDN Git Service

ALSA: korg1212: Fix wrongly shuffled firmware loader code
authorTakashi Iwai <tiwai@suse.de>
Tue, 20 Jul 2021 22:28:01 +0000 (00:28 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 20 Jul 2021 22:32:25 +0000 (00:32 +0200)
commitd364a600d6ed9cd78744031a36627d21a6deaefd
treeacb5bd7d78f43ea1cd436733d550d3f29689ce57
parentf263a2c2d6c7c44e9256e6a24c9fec668f22ff8b
ALSA: korg1212: Fix wrongly shuffled firmware loader code

The recent change for the devres introduced the wrong code shuffling
in the korg1212 firmware loader function that may lead to a bad
pointer access.  Restore the calls in the right order (and put back
the release_firmware() call in the error path, too).

Fixes: b5cde369b618 ("ALSA: korg1212: Allocate resources with device-managed APIs")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/s5heebsoc26.wl-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/korg1212/korg1212.c