10 Nov
2014
10 Nov
'14
11 p.m.
<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