Skip to content

Commit

Permalink
ALSA: fireworks: fix memory leak of response buffer at error path
Browse files Browse the repository at this point in the history
After allocating memory object for response buffer, ALSA fireworks
driver has leak of the memory object at error path.

This commit releases the object at the error path.

Fixes: 7d3c1d5('ALSA: fireworks: 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>
  • Loading branch information
Takashi Sakamoto authored and Takashi Iwai committed Sep 17, 2018
1 parent 1064bc6 commit c3b55e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/firewire/fireworks/fireworks.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ do_registration(struct work_struct *work)
snd_efw_transaction_remove_instance(efw);
snd_efw_stream_destroy_duplex(efw);
snd_card_free(efw->card);
kfree(efw->resp_buf);
efw->resp_buf = NULL;
dev_info(&efw->unit->device,
"Sound card registration failed: %d\n", err);
}
Expand Down

0 comments on commit c3b55e2

Please sign in to comment.