diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2018-09-17 04:26:08 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-09-17 07:40:09 -0400 |
commit | ce925f088b979537f22f9e05eb923ef9822ca139 (patch) | |
tree | f318e44802df1ef27788832aaf98c24511a5d79c | |
parent | b1fbebd4164b3d170ad916dcd692cf843c9c065d (diff) |
ALSA: oxfw: fix memory leak for model-dependent data at error path
After allocating model-dependent data, ALSA OXFW driver has memory leak
of the data at error path.
This commit releases the data at the error path.
Fixes: 6c29230e2a5f ('ALSA: oxfw: delayed registration of sound card')
Cc: <stable@vger.kernel.org> # v4.7+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/firewire/oxfw/oxfw.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index fd34ef2ac679..75c6ba2fe3dc 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c | |||
@@ -271,6 +271,8 @@ error: | |||
271 | if (oxfw->has_output) | 271 | if (oxfw->has_output) |
272 | snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream); | 272 | snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream); |
273 | snd_card_free(oxfw->card); | 273 | snd_card_free(oxfw->card); |
274 | kfree(oxfw->spec); | ||
275 | oxfw->spec = NULL; | ||
274 | dev_info(&oxfw->unit->device, | 276 | dev_info(&oxfw->unit->device, |
275 | "Sound card registration failed: %d\n", err); | 277 | "Sound card registration failed: %d\n", err); |
276 | } | 278 | } |