mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
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: 6c29230e2a
('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>
This commit is contained in:
parent
b1fbebd416
commit
ce925f088b
1 changed files with 2 additions and 0 deletions
|
@ -271,6 +271,8 @@ static void do_registration(struct work_struct *work)
|
||||||
if (oxfw->has_output)
|
if (oxfw->has_output)
|
||||||
snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
|
snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
|
||||||
snd_card_free(oxfw->card);
|
snd_card_free(oxfw->card);
|
||||||
|
kfree(oxfw->spec);
|
||||||
|
oxfw->spec = NULL;
|
||||||
dev_info(&oxfw->unit->device,
|
dev_info(&oxfw->unit->device,
|
||||||
"Sound card registration failed: %d\n", err);
|
"Sound card registration failed: %d\n", err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue