Skip to content

Commit

Permalink
ALSA: isight: fix leak of reference to firewire unit in error path of…
Browse files Browse the repository at this point in the history
… .probe callback

[ Upstream commit 51e68fb ]

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

Fixes: 5b14ec2('ALSA: firewire: release reference count of firewire unit in .remove callback of bus driver')
Signed-off-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
takaswie authored and gregkh committed Nov 28, 2019
1 parent 9c8e98a commit d1f08bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sound/firewire/isight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d1f08bc

Please sign in to comment.