Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: bebob: use managed-resource to maintain data specific to M-Audio FW-1814/ProjectMix I/O

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Sakamoto and committed by
Takashi Iwai
a3aaf7d2 366a20d7

+3 -6
-4
sound/firewire/bebob/bebob.c
··· 130 130 { 131 131 snd_bebob_stream_destroy_duplex(bebob); 132 132 133 - kfree(bebob->maudio_special_quirk); 134 - 135 133 mutex_destroy(&bebob->mutex); 136 134 fw_unit_put(bebob->unit); 137 135 } ··· 260 262 error: 261 263 mutex_unlock(&devices_mutex); 262 264 snd_bebob_stream_destroy_duplex(bebob); 263 - kfree(bebob->maudio_special_quirk); 264 - bebob->maudio_special_quirk = NULL; 265 265 snd_card_free(bebob->card); 266 266 dev_info(&bebob->unit->device, 267 267 "Sound card registration failed: %d\n", err);
+3 -2
sound/firewire/bebob/bebob_maudio.c
··· 261 261 struct special_params *params; 262 262 int err; 263 263 264 - params = kzalloc(sizeof(struct special_params), GFP_KERNEL); 265 - if (params == NULL) 264 + params = devm_kzalloc(&bebob->card->card_dev, 265 + sizeof(struct special_params), GFP_KERNEL); 266 + if (!params) 266 267 return -ENOMEM; 267 268 268 269 mutex_lock(&bebob->mutex);