Skip to content

Commit

Permalink
ALSA: firewire-tascam: fix memory leak of private data
Browse files Browse the repository at this point in the history
Although private data of sound card instance is usually allocated in the
tail of the instance, drivers in ALSA firewire stack allocate the private
data before allocating the instance. In this case, the private data
should be released explicitly at .private_free callback of the instance.

This commit fixes memory leak following to the above design.

Fixes: b610386 ('ALSA: firewire-tascam: deleyed 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 13, 2018
1 parent a49a83a commit 8d28277
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/firewire/tascam/tascam.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ static void tscm_free(struct snd_tscm *tscm)
fw_unit_put(tscm->unit);

mutex_destroy(&tscm->mutex);
kfree(tscm);
}

static void tscm_card_free(struct snd_card *card)
Expand Down

0 comments on commit 8d28277

Please sign in to comment.