Skip to content

Commit

Permalink
ALSA: oxfw: fix memory leak for model-dependent data at error path
Browse files Browse the repository at this point in the history
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: 6c29230 ('ALSA: oxfw: delayed registration of sound card')
Cc: <[email protected]> # v4.7+
Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
takaswie authored and tiwai committed Sep 17, 2018
1 parent b1fbebd commit ce925f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/firewire/oxfw/oxfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ static void do_registration(struct work_struct *work)
if (oxfw->has_output)
snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
snd_card_free(oxfw->card);
kfree(oxfw->spec);
oxfw->spec = NULL;
dev_info(&oxfw->unit->device,
"Sound card registration failed: %d\n", err);
}
Expand Down

0 comments on commit ce925f0

Please sign in to comment.