Skip to content

Commit

Permalink
ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at…
Browse files Browse the repository at this point in the history
… error path

After allocating model-dependent data for M-Audio FW1814 and ProjectMix
I/O, ALSA bebob driver has memory leak at error path.

This commit releases the allocated data at the error path.

Fixes: 04a2c73('ALSA: bebob: 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 37a3a98 commit b1fbebd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions sound/firewire/bebob/bebob.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ do_registration(struct work_struct *work)
error:
mutex_unlock(&devices_mutex);
snd_bebob_stream_destroy_duplex(bebob);
kfree(bebob->maudio_special_quirk);
bebob->maudio_special_quirk = NULL;
snd_card_free(bebob->card);
dev_info(&bebob->unit->device,
"Sound card registration failed: %d\n", err);
Expand Down
4 changes: 0 additions & 4 deletions sound/firewire/bebob/bebob_maudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814)
bebob->midi_output_ports = 2;
}
end:
if (err < 0) {
kfree(params);
bebob->maudio_special_quirk = NULL;
}
mutex_unlock(&bebob->mutex);
return err;
}
Expand Down

0 comments on commit b1fbebd

Please sign in to comment.