diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-09-09 09:25:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-09-10 03:08:14 -0400 |
commit | 36f3a6e02c143a7e9e4e143e416371f67bc1fae6 (patch) | |
tree | ed86bc1b0b5818b4c223c5bf82b8827d3a1a466a /sound/firewire/fireface | |
parent | 493626f2d87a74e6dbea1686499ed6e7e600484e (diff) |
ALSA: fireface: fix memory leak in ff400_switch_fetching_mode()
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>
Diffstat (limited to 'sound/firewire/fireface')
-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 ad7a0a32557d..64c3cb0fb926 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) | |||
146 | { | 146 | { |
147 | __le32 *reg; | 147 | __le32 *reg; |
148 | int i; | 148 | int i; |
149 | int err; | ||
149 | 150 | ||
150 | reg = kcalloc(18, sizeof(__le32), GFP_KERNEL); | 151 | reg = kcalloc(18, sizeof(__le32), GFP_KERNEL); |
151 | if (reg == NULL) | 152 | if (reg == NULL) |
@@ -163,9 +164,11 @@ static int ff400_switch_fetching_mode(struct snd_ff *ff, bool enable) | |||
163 | reg[i] = cpu_to_le32(0x00000001); | 164 | reg[i] = cpu_to_le32(0x00000001); |
164 | } | 165 | } |
165 | 166 | ||
166 | return snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, | 167 | err = snd_fw_transaction(ff->unit, TCODE_WRITE_BLOCK_REQUEST, |
167 | FF400_FETCH_PCM_FRAMES, reg, | 168 | FF400_FETCH_PCM_FRAMES, reg, |
168 | sizeof(__le32) * 18, 0); | 169 | sizeof(__le32) * 18, 0); |
170 | kfree(reg); | ||
171 | return err; | ||
169 | } | 172 | } |
170 | 173 | ||
171 | static void ff400_dump_sync_status(struct snd_ff *ff, | 174 | static void ff400_dump_sync_status(struct snd_ff *ff, |