mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at 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: 04a2c73c97eb('ALSA: bebob: 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
37a3a98ef6
commit
b1fbebd416
2 changed files with 2 additions and 4 deletions
|
@ -263,6 +263,8 @@ do_registration(struct work_struct *work)
|
||||||
error:
|
error:
|
||||||
mutex_unlock(&devices_mutex);
|
mutex_unlock(&devices_mutex);
|
||||||
snd_bebob_stream_destroy_duplex(bebob);
|
snd_bebob_stream_destroy_duplex(bebob);
|
||||||
|
kfree(bebob->maudio_special_quirk);
|
||||||
|
bebob->maudio_special_quirk = NULL;
|
||||||
snd_card_free(bebob->card);
|
snd_card_free(bebob->card);
|
||||||
dev_info(&bebob->unit->device,
|
dev_info(&bebob->unit->device,
|
||||||
"Sound card registration failed: %d\n", err);
|
"Sound card registration failed: %d\n", err);
|
||||||
|
|
|
@ -294,10 +294,6 @@ snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814)
|
||||||
bebob->midi_output_ports = 2;
|
bebob->midi_output_ports = 2;
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
if (err < 0) {
|
|
||||||
kfree(params);
|
|
||||||
bebob->maudio_special_quirk = NULL;
|
|
||||||
}
|
|
||||||
mutex_unlock(&bebob->mutex);
|
mutex_unlock(&bebob->mutex);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue