[alsa-devel] [PATCH 4/4 v6] ALSA: usb-audio: Scarlett mixer interface for 6i6, 18i6, 18i8 and 18i20
Chris J Arges
chris.j.arges at canonical.com
Mon Nov 10 23:00:17 CET 2014
<snip>
> However...
>
>> + }
>> +
>> + /* assign to the appropriate control */
>> + info->opt_master.names = (const char * const *)names;
>> + info->opt_matrix.names = (const char * const *)names;
>
> ... I guess these will be leaked without destructor? This has to be
> fixed. You need to add a flag indicating the need of kfree() and do
> it in the own destructor accordingly.
>
>
> thanks,
>
> Takashi
>
Where is the best place for this destructor?
At the end of the snd_scarlett_controls_create function doesn't work due
to opt_*.names being referenced by scarlett_ctl_enum_info afterwards.
Creating a custom private_free callback doesn't seem correct either as I
should only need to free the memory once and not repeatedly. However
with a flag I could check and only free once on the callback.
Thanks,
--chris
More information about the Alsa-devel
mailing list