[alsa-devel] [PATCH 0/5] ALSA: use managed-resource to maintain allocated buffers
Hi,
Linux Device Driver subsystem has a feature of 'devres', which is resource allocator/deallocator synchronously to reference counter of kobject corresponding to device structure. This feature avoid memory leak from programming mistakes.
This patchset replaces calls of allocator/deallocator with devres helper functions. There're two types of target device structure; firewire unit device and sound card device. All drivers in ALSA firewire stack use reference counting to serialize timing to release the type of two device, therefore no worries of dereferencing to released memory objects.
This patchset is for v4.20 and based on my series of fix patches in 'sound-4.19-rc5' branch. But current 'for-next' branch doesn't include them. So this patchset is rebased to upstream 'master' branch (HEAD=067284726963). I'm OK to take them pending till the '-rc5' is merged.
Takashi Sakamoto (5): ALSA: firewire: use managed-resource of fw unit device for private data ALSA: bebob: use managed-resource to maintain data specific to M-Audio FW-1814/ProjectMix I/O ALSA: fireworks: use managed-resource to maintain response buffer ALSA: oxfw: use managed-resource to maintain model-specific data ALSA: oxfw: use managed-resource to maintain cache of stream formats
sound/firewire/bebob/bebob.c | 17 ++++++----------- sound/firewire/bebob/bebob_maudio.c | 5 +++-- sound/firewire/dice/dice.c | 8 +++----- sound/firewire/digi00x/digi00x.c | 9 ++++----- sound/firewire/fireface/ff.c | 10 +++------- sound/firewire/fireworks/fireworks.c | 15 +++++---------- sound/firewire/motu/motu.c | 10 ++++------ sound/firewire/oxfw/oxfw-scs1x.c | 5 +++-- sound/firewire/oxfw/oxfw-spkr.c | 5 +++-- sound/firewire/oxfw/oxfw-stream.c | 13 ++++++++----- sound/firewire/oxfw/oxfw.c | 28 ++++------------------------ sound/firewire/tascam/tascam.c | 10 +++------- 12 files changed, 49 insertions(+), 86 deletions(-)
At present, private data of each driver in ALSA firewire stack is allocated/freed by kernel slab allocator for corresponding unit on IEEE 1394 bus. In this case, resource-managed slab allocator is available to release memory object automatically just before releasing device structure for the unit. This idea can prevent runtime from memory leak due to programming mistakes.
This commit uses the allocator for the private data. These drivers already use reference counter to maintain lifetime of device structure for the unit by a pair of fw_unit_get()/fw_unit_put(). The private data is safely released in a callback of 'struct snd_card.private_free().
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob.c | 13 ++++++------- sound/firewire/dice/dice.c | 8 +++----- sound/firewire/digi00x/digi00x.c | 9 ++++----- sound/firewire/fireface/ff.c | 10 +++------- sound/firewire/fireworks/fireworks.c | 6 ++---- sound/firewire/motu/motu.c | 10 ++++------ sound/firewire/oxfw/oxfw.c | 11 ++++------- sound/firewire/tascam/tascam.c | 10 +++------- 8 files changed, 29 insertions(+), 48 deletions(-)
diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index 93676354f87f..fb05f2c1b60b 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -129,12 +129,11 @@ name_device(struct snd_bebob *bebob) static void bebob_free(struct snd_bebob *bebob) { snd_bebob_stream_destroy_duplex(bebob); - fw_unit_put(bebob->unit);
kfree(bebob->maudio_special_quirk);
mutex_destroy(&bebob->mutex); - kfree(bebob); + fw_unit_put(bebob->unit); }
/* @@ -295,15 +294,15 @@ bebob_probe(struct fw_unit *unit, const struct ieee1394_device_id *entry) }
/* Allocate this independent of sound card instance. */ - bebob = kzalloc(sizeof(struct snd_bebob), GFP_KERNEL); - if (bebob == NULL) + bebob = devm_kzalloc(&unit->device, sizeof(struct snd_bebob), + GFP_KERNEL); + if (!bebob) return -ENOMEM; - bebob->unit = fw_unit_get(unit); - bebob->entry = entry; - bebob->spec = spec; dev_set_drvdata(&unit->device, bebob);
+ bebob->entry = entry; + bebob->spec = spec; mutex_init(&bebob->mutex); spin_lock_init(&bebob->lock); init_waitqueue_head(&bebob->hwdep_wait); diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c index 774eb2205668..9bf77adb3127 100644 --- a/sound/firewire/dice/dice.c +++ b/sound/firewire/dice/dice.c @@ -126,10 +126,9 @@ static void dice_free(struct snd_dice *dice) { snd_dice_stream_destroy_duplex(dice); snd_dice_transaction_destroy(dice); - fw_unit_put(dice->unit);
mutex_destroy(&dice->mutex); - kfree(dice); + fw_unit_put(dice->unit); }
/* @@ -223,10 +222,9 @@ static int dice_probe(struct fw_unit *unit, }
/* Allocate this independent of sound card instance. */ - dice = kzalloc(sizeof(struct snd_dice), GFP_KERNEL); - if (dice == NULL) + dice = devm_kzalloc(&unit->device, sizeof(struct snd_dice), GFP_KERNEL); + if (!dice) return -ENOMEM; - dice->unit = fw_unit_get(unit); dev_set_drvdata(&unit->device, dice);
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); 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);
diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c index f2d073365cf6..2ff7b9cff9b0 100644 --- a/sound/firewire/fireworks/fireworks.c +++ b/sound/firewire/fireworks/fireworks.c @@ -188,12 +188,11 @@ static void efw_free(struct snd_efw *efw) { snd_efw_stream_destroy_duplex(efw); snd_efw_transaction_remove_instance(efw); - fw_unit_put(efw->unit);
kfree(efw->resp_buf);
mutex_destroy(&efw->mutex); - kfree(efw); + fw_unit_put(efw->unit); }
/* @@ -312,10 +311,9 @@ efw_probe(struct fw_unit *unit, const struct ieee1394_device_id *entry) { struct snd_efw *efw;
- efw = kzalloc(sizeof(struct snd_efw), GFP_KERNEL); + efw = devm_kzalloc(&unit->device, sizeof(struct snd_efw), GFP_KERNEL); if (efw == NULL) return -ENOMEM; - efw->unit = fw_unit_get(unit); dev_set_drvdata(&unit->device, efw);
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c index 300d31b6f191..fd5726424c7a 100644 --- a/sound/firewire/motu/motu.c +++ b/sound/firewire/motu/motu.c @@ -57,10 +57,9 @@ static void motu_free(struct snd_motu *motu) snd_motu_transaction_unregister(motu);
snd_motu_stream_destroy_duplex(motu); - fw_unit_put(motu->unit);
mutex_destroy(&motu->mutex); - kfree(motu); + fw_unit_put(motu->unit); }
/* @@ -143,14 +142,13 @@ static int motu_probe(struct fw_unit *unit, struct snd_motu *motu;
/* Allocate this independently of sound card instance. */ - motu = kzalloc(sizeof(struct snd_motu), GFP_KERNEL); - if (motu == NULL) + motu = devm_kzalloc(&unit->device, sizeof(struct snd_motu), GFP_KERNEL); + if (!motu) return -ENOMEM; - - motu->spec = (const struct snd_motu_spec *)entry->driver_data; motu->unit = fw_unit_get(unit); dev_set_drvdata(&unit->device, motu);
+ motu->spec = (const struct snd_motu_spec *)entry->driver_data; mutex_init(&motu->mutex); spin_lock_init(&motu->lock); init_waitqueue_head(&motu->hwdep_wait); diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 2ea8be6c8584..b892a8642204 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -121,8 +121,6 @@ static void oxfw_free(struct snd_oxfw *oxfw) if (oxfw->has_output) snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
- fw_unit_put(oxfw->unit); - for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) { kfree(oxfw->tx_stream_formats[i]); kfree(oxfw->rx_stream_formats[i]); @@ -130,7 +128,7 @@ static void oxfw_free(struct snd_oxfw *oxfw)
kfree(oxfw->spec); mutex_destroy(&oxfw->mutex); - kfree(oxfw); + fw_unit_put(oxfw->unit); }
/* @@ -293,14 +291,13 @@ static int oxfw_probe(struct fw_unit *unit, return -ENODEV;
/* Allocate this independent of sound card instance. */ - oxfw = kzalloc(sizeof(struct snd_oxfw), GFP_KERNEL); - if (oxfw == NULL) + oxfw = devm_kzalloc(&unit->device, sizeof(struct snd_oxfw), GFP_KERNEL); + if (!oxfw) return -ENOMEM; - - oxfw->entry = entry; oxfw->unit = fw_unit_get(unit); dev_set_drvdata(&unit->device, oxfw);
+ oxfw->entry = entry; mutex_init(&oxfw->mutex); spin_lock_init(&oxfw->lock); init_waitqueue_head(&oxfw->hwdep_wait); diff --git a/sound/firewire/tascam/tascam.c b/sound/firewire/tascam/tascam.c index d3fdc463a884..53f20153ba71 100644 --- a/sound/firewire/tascam/tascam.c +++ b/sound/firewire/tascam/tascam.c @@ -90,10 +90,8 @@ static void tscm_free(struct snd_tscm *tscm) snd_tscm_transaction_unregister(tscm); snd_tscm_stream_destroy_duplex(tscm);
- fw_unit_put(tscm->unit); - mutex_destroy(&tscm->mutex); - kfree(tscm); + fw_unit_put(tscm->unit); }
static void tscm_card_free(struct snd_card *card) @@ -164,11 +162,9 @@ static int snd_tscm_probe(struct fw_unit *unit, struct snd_tscm *tscm;
/* Allocate this independent of sound card instance. */ - tscm = kzalloc(sizeof(struct snd_tscm), GFP_KERNEL); - if (tscm == NULL) + tscm = devm_kzalloc(&unit->device, sizeof(struct snd_tscm), GFP_KERNEL); + if (!tscm) return -ENOMEM; - - /* initialize myself */ tscm->unit = fw_unit_get(unit); dev_set_drvdata(&unit->device, tscm);
ALSA bebob driver allocates memory object for data specific to M-Audio FW-1884/ProjectMix I/O. The object is to maintain format of isochronous packet payload for packet streaming by components for ALSA rawMIDI/PCM interfaces. The object can be released as managed-resource of 'struct snd_card.card_dev'.
This commit uses managed-resource of the sound card device for this purpose.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/bebob/bebob.c | 4 ---- sound/firewire/bebob/bebob_maudio.c | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index fb05f2c1b60b..72b04214a3b5 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -130,8 +130,6 @@ static void bebob_free(struct snd_bebob *bebob) { snd_bebob_stream_destroy_duplex(bebob);
- kfree(bebob->maudio_special_quirk); - mutex_destroy(&bebob->mutex); fw_unit_put(bebob->unit); } @@ -262,8 +260,6 @@ do_registration(struct work_struct *work) error: mutex_unlock(&devices_mutex); snd_bebob_stream_destroy_duplex(bebob); - kfree(bebob->maudio_special_quirk); - bebob->maudio_special_quirk = NULL; snd_card_free(bebob->card); dev_info(&bebob->unit->device, "Sound card registration failed: %d\n", err); diff --git a/sound/firewire/bebob/bebob_maudio.c b/sound/firewire/bebob/bebob_maudio.c index c266997ad299..51152ca4af57 100644 --- a/sound/firewire/bebob/bebob_maudio.c +++ b/sound/firewire/bebob/bebob_maudio.c @@ -261,8 +261,9 @@ snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814) struct special_params *params; int err;
- params = kzalloc(sizeof(struct special_params), GFP_KERNEL); - if (params == NULL) + params = devm_kzalloc(&bebob->card->card_dev, + sizeof(struct special_params), GFP_KERNEL); + if (!params) return -ENOMEM;
mutex_lock(&bebob->mutex);
ALSA fireworks driver allocates memory object to handle response from target unit. The object is used to initiate transaction unique to Fireworks board module. This can be released as managed-resource of 'struct snd_card.card_dev'.
This commit uses managed-resource of the sound card device for this purpose.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/fireworks/fireworks.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c index 2ff7b9cff9b0..f680e2f27806 100644 --- a/sound/firewire/fireworks/fireworks.c +++ b/sound/firewire/fireworks/fireworks.c @@ -189,8 +189,6 @@ static void efw_free(struct snd_efw *efw) snd_efw_stream_destroy_duplex(efw); snd_efw_transaction_remove_instance(efw);
- kfree(efw->resp_buf); - mutex_destroy(&efw->mutex); fw_unit_put(efw->unit); } @@ -247,8 +245,9 @@ do_registration(struct work_struct *work) /* prepare response buffer */ snd_efw_resp_buf_size = clamp(snd_efw_resp_buf_size, SND_EFW_RESPONSE_MAXIMUM_BYTES, 4096U); - efw->resp_buf = kzalloc(snd_efw_resp_buf_size, GFP_KERNEL); - if (efw->resp_buf == NULL) { + efw->resp_buf = devm_kzalloc(&efw->card->card_dev, + snd_efw_resp_buf_size, GFP_KERNEL); + if (!efw->resp_buf) { err = -ENOMEM; goto error; } @@ -300,8 +299,6 @@ do_registration(struct work_struct *work) snd_efw_transaction_remove_instance(efw); snd_efw_stream_destroy_duplex(efw); snd_card_free(efw->card); - kfree(efw->resp_buf); - efw->resp_buf = NULL; dev_info(&efw->unit->device, "Sound card registration failed: %d\n", err); }
ALSA oxfw driver allocates memory objects for data specific to some models. These objects are used to maintain functionalities specific to the models for ALSA rawMIDI/control interfaces. They can be released as managed-resource of 'struct snd_card.card_dev'.
This commit uses managed-resource of the sound card device for this purpose.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/oxfw/oxfw-scs1x.c | 5 +++-- sound/firewire/oxfw/oxfw-spkr.c | 5 +++-- sound/firewire/oxfw/oxfw.c | 3 --- 3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/sound/firewire/oxfw/oxfw-scs1x.c b/sound/firewire/oxfw/oxfw-scs1x.c index f33497cdc706..9d9545880a28 100644 --- a/sound/firewire/oxfw/oxfw-scs1x.c +++ b/sound/firewire/oxfw/oxfw-scs1x.c @@ -372,8 +372,9 @@ int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw) struct fw_scs1x *scs; int err;
- scs = kzalloc(sizeof(struct fw_scs1x), GFP_KERNEL); - if (scs == NULL) + scs = devm_kzalloc(&oxfw->card->card_dev, sizeof(struct fw_scs1x), + GFP_KERNEL); + if (!scs) return -ENOMEM; scs->fw_dev = fw_parent_device(oxfw->unit); oxfw->spec = scs; diff --git a/sound/firewire/oxfw/oxfw-spkr.c b/sound/firewire/oxfw/oxfw-spkr.c index cb905af0660d..66d4b1f73f0f 100644 --- a/sound/firewire/oxfw/oxfw-spkr.c +++ b/sound/firewire/oxfw/oxfw-spkr.c @@ -270,8 +270,9 @@ int snd_oxfw_add_spkr(struct snd_oxfw *oxfw, bool is_lacie) unsigned int i, first_ch; int err;
- spkr = kzalloc(sizeof(struct fw_spkr), GFP_KERNEL); - if (spkr == NULL) + spkr = devm_kzalloc(&oxfw->card->card_dev, sizeof(struct fw_spkr), + GFP_KERNEL); + if (!spkr) return -ENOMEM; oxfw->spec = spkr;
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index b892a8642204..06d791acfdc5 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -126,7 +126,6 @@ static void oxfw_free(struct snd_oxfw *oxfw) kfree(oxfw->rx_stream_formats[i]); }
- kfree(oxfw->spec); mutex_destroy(&oxfw->mutex); fw_unit_put(oxfw->unit); } @@ -276,8 +275,6 @@ static void do_registration(struct work_struct *work) oxfw->rx_stream_formats[i] = NULL; } snd_card_free(oxfw->card); - kfree(oxfw->spec); - oxfw->spec = NULL; dev_info(&oxfw->unit->device, "Sound card registration failed: %d\n", err); }
ALSA oxfw driver allocates memory objects for cache of stream formats. The objects are used to maintain packet streaming by components for ALSA rawMIDI/PCM interface. They can be released as managed-resource of 'struct snd_card.card_dev'.
This commit uses managed-resource of the sound card device for this purpose.
Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/firewire/oxfw/oxfw-stream.c | 13 ++++++++----- sound/firewire/oxfw/oxfw.c | 14 -------------- 2 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index d9361f352133..f230a9e44c3c 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -517,8 +517,9 @@ assume_stream_formats(struct snd_oxfw *oxfw, enum avc_general_plug_dir dir, if (err < 0) goto end;
- formats[eid] = kmemdup(buf, *len, GFP_KERNEL); - if (formats[eid] == NULL) { + formats[eid] = devm_kmemdup(&oxfw->card->card_dev, buf, *len, + GFP_KERNEL); + if (!formats[eid]) { err = -ENOMEM; goto end; } @@ -535,7 +536,8 @@ assume_stream_formats(struct snd_oxfw *oxfw, enum avc_general_plug_dir dir, continue;
eid++; - formats[eid] = kmemdup(buf, *len, GFP_KERNEL); + formats[eid] = devm_kmemdup(&oxfw->card->card_dev, buf, *len, + GFP_KERNEL); if (formats[eid] == NULL) { err = -ENOMEM; goto end; @@ -597,8 +599,9 @@ static int fill_stream_formats(struct snd_oxfw *oxfw, if (err < 0) break;
- formats[eid] = kmemdup(buf, len, GFP_KERNEL); - if (formats[eid] == NULL) { + formats[eid] = devm_kmemdup(&oxfw->card->card_dev, buf, len, + GFP_KERNEL); + if (!formats[eid]) { err = -ENOMEM; break; } diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 06d791acfdc5..6ac551786b93 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -115,17 +115,10 @@ static int name_card(struct snd_oxfw *oxfw)
static void oxfw_free(struct snd_oxfw *oxfw) { - unsigned int i; - snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream); if (oxfw->has_output) snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);
- for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) { - kfree(oxfw->tx_stream_formats[i]); - kfree(oxfw->rx_stream_formats[i]); - } - mutex_destroy(&oxfw->mutex); fw_unit_put(oxfw->unit); } @@ -205,7 +198,6 @@ static int detect_quirks(struct snd_oxfw *oxfw) static void do_registration(struct work_struct *work) { struct snd_oxfw *oxfw = container_of(work, struct snd_oxfw, dwork.work); - int i; int err;
if (oxfw->registered) @@ -268,12 +260,6 @@ static void do_registration(struct work_struct *work) snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream); if (oxfw->has_output) snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream); - for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; ++i) { - kfree(oxfw->tx_stream_formats[i]); - oxfw->tx_stream_formats[i] = NULL; - kfree(oxfw->rx_stream_formats[i]); - oxfw->rx_stream_formats[i] = NULL; - } snd_card_free(oxfw->card); dev_info(&oxfw->unit->device, "Sound card registration failed: %d\n", err);
On Wed, 03 Oct 2018 01:21:49 +0200, Takashi Sakamoto wrote:
Hi,
Linux Device Driver subsystem has a feature of 'devres', which is resource allocator/deallocator synchronously to reference counter of kobject corresponding to device structure. This feature avoid memory leak from programming mistakes.
This patchset replaces calls of allocator/deallocator with devres helper functions. There're two types of target device structure; firewire unit device and sound card device. All drivers in ALSA firewire stack use reference counting to serialize timing to release the type of two device, therefore no worries of dereferencing to released memory objects.
This patchset is for v4.20 and based on my series of fix patches in 'sound-4.19-rc5' branch. But current 'for-next' branch doesn't include them. So this patchset is rebased to upstream 'master' branch (HEAD=067284726963). I'm OK to take them pending till the '-rc5' is merged.
Takashi Sakamoto (5): ALSA: firewire: use managed-resource of fw unit device for private data ALSA: bebob: use managed-resource to maintain data specific to M-Audio FW-1814/ProjectMix I/O ALSA: fireworks: use managed-resource to maintain response buffer ALSA: oxfw: use managed-resource to maintain model-specific data ALSA: oxfw: use managed-resource to maintain cache of stream formats
I merged for-linus into for-next, and applied all five patches now. Thanks.
Takashi
participants (2)
-
Takashi Iwai
-
Takashi Sakamoto