Skip to content

Commit

Permalink
ALSA: fireface: fix memory leak in ff400_switch_fetching_mode()
Browse files Browse the repository at this point in the history
An allocated memory forgets to be released.

Fixes: 76fdb3a ('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>
  • Loading branch information
Takashi Sakamoto authored and Takashi Iwai committed Sep 10, 2018
1 parent 493626f commit 36f3a6e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sound/firewire/fireface/ff-protocol-ff400.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable)
{
__le32 *reg;
int i;
int err;

reg = kcalloc(18, sizeof(__le32), GFP_KERNEL);
if (reg == NULL)
Expand All @@ -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,
Expand Down

0 comments on commit 36f3a6e

Please sign in to comment.