diff options
Diffstat (limited to 'sound/firewire/digi00x/digi00x.c')
-rw-r--r-- | sound/firewire/digi00x/digi00x.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/firewire/digi00x/digi00x.c b/sound/firewire/digi00x/digi00x.c index ef689997d6a5..654420f1c9bd 100644 --- a/sound/firewire/digi00x/digi00x.c +++ b/sound/firewire/digi00x/digi00x.c @@ -46,10 +46,8 @@ static void dg00x_free(struct snd_dg00x *dg00x) snd_dg00x_stream_destroy_duplex(dg00x); snd_dg00x_transaction_unregister(dg00x); - fw_unit_put(dg00x->unit); - mutex_destroy(&dg00x->mutex); - kfree(dg00x); + fw_unit_put(dg00x->unit); } static void dg00x_card_free(struct snd_card *card) @@ -120,8 +118,9 @@ static int snd_dg00x_probe(struct fw_unit *unit, struct snd_dg00x *dg00x; /* Allocate this independent of sound card instance. */ - dg00x = kzalloc(sizeof(struct snd_dg00x), GFP_KERNEL); - if (dg00x == NULL) + dg00x = devm_kzalloc(&unit->device, sizeof(struct snd_dg00x), + GFP_KERNEL); + if (!dg00x) return -ENOMEM; dg00x->unit = fw_unit_get(unit); |