aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireface/ff.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/fireface/ff.c')
-rw-r--r--sound/firewire/fireface/ff.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/firewire/fireface/ff.c b/sound/firewire/fireface/ff.c
index 4974bc7980e9..98731bd8816f 100644
--- a/sound/firewire/fireface/ff.c
+++ b/sound/firewire/fireface/ff.c
@@ -32,10 +32,8 @@ static void ff_free(struct snd_ff *ff)
snd_ff_stream_destroy_duplex(ff);
snd_ff_transaction_unregister(ff);
- fw_unit_put(ff->unit);
-
mutex_destroy(&ff->mutex);
- kfree(ff);
+ fw_unit_put(ff->unit);
}
static void ff_card_free(struct snd_card *card)
@@ -102,11 +100,9 @@ static int snd_ff_probe(struct fw_unit *unit,
{
struct snd_ff *ff;
- ff = kzalloc(sizeof(struct snd_ff), GFP_KERNEL);
- if (ff == NULL)
+ ff = devm_kzalloc(&unit->device, sizeof(struct snd_ff), GFP_KERNEL);
+ if (!ff)
return -ENOMEM;
-
- /* initialize myself */
ff->unit = fw_unit_get(unit);
dev_set_drvdata(&unit->device, ff);