diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-09-09 22:25:52 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-29 03:06:02 -0700 |
commit | 70165a445b00c7bb0f68c955da3c100817ac0c87 (patch) | |
tree | ad27d4df010c7df406c3968d8bb20ec89d161b1e | |
parent | 352701c288c1aef805d1c904c9de3b3a211ac71b (diff) | |
download | linux-stable-70165a445b00c7bb0f68c955da3c100817ac0c87.tar.gz linux-stable-70165a445b00c7bb0f68c955da3c100817ac0c87.tar.bz2 linux-stable-70165a445b00c7bb0f68c955da3c100817ac0c87.zip |
ALSA: fireface: fix memory leak in ff400_switch_fetching_mode()
commit 36f3a6e02c143a7e9e4e143e416371f67bc1fae6 upstream.
An allocated memory forgets to be released.
Fixes: 76fdb3a9e13 ('ALSA: fireface: add support for Fireface 400')
Cc: <stable@vger.kernel.org> # 4.12+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | sound/firewire/fireface/ff-protocol-ff400.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/firewire/fireface/ff-protocol-ff400.c b/sound/firewire/fireface/ff-protocol-ff400.c index 12aa15df435d..9f5036442ab9 100644 --- a/sound/firewire/fireface/ff-protocol-ff400.c +++ b/sound/firewire/fireface/ff-protocol-ff400.c @@ -146,6 +146,7 @@ static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable) { __le32 *reg; int i; + int err; reg = kzalloc(sizeof(__le32) * 18, GFP_KERNEL); if (reg == NULL) @@ -163,9 +164,11 @@ static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable) reg[i] = cpu_to_le32(0x00000001); } - return snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, - FF400_FETCH_PCM_FRAMES, reg, - sizeof(__le32) * 18, 0); + err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, + FF400_FETCH_PCM_FRAMES, reg, + sizeof(__le32) * 18, 0); + kfree(reg); + return err; } static void ff400_dump_sync_status(struct snd_ff *ff, |