Commit 53bdac90 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Kleber Sacilotto de Souza

ALSA: isight: fix leak of reference to firewire unit in error path of .probe callback

BugLink: https://bugs.launchpad.net/bugs/1854855

[ Upstream commit 51e68fb0 ]

In some error paths, reference count of firewire unit is not decreased.
This commit fixes the bug.

Fixes: 5b14ec25('ALSA: firewire: release reference count of firewire unit in .remove callback of bus driver')
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 1b91cb94
......@@ -639,7 +639,7 @@ static int isight_probe(struct fw_unit *unit,
if (!isight->audio_base) {
dev_err(&unit->device, "audio unit base not found\n");
err = -ENXIO;
goto err_unit;
goto error;
}
fw_iso_resources_init(&isight->resources, unit);
......@@ -668,12 +668,12 @@ static int isight_probe(struct fw_unit *unit,
dev_set_drvdata(&unit->device, isight);
return 0;
err_unit:
fw_unit_put(isight->unit);
mutex_destroy(&isight->mutex);
error:
snd_card_free(card);
mutex_destroy(&isight->mutex);
fw_unit_put(isight->unit);
return err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment