10 Aug
2023
10 Aug
'23
8:55 p.m.
On Thu, Aug 10, 2023 at 07:47:37PM +0800, Li Zetao wrote:
- tas5805m->dsp_cfg_data = devm_kmalloc(dev, fw->size, GFP_KERNEL);
- tas5805m->dsp_cfg_data = devm_kmemdup(dev, fw->data, fw->size, GFP_KERNEL); if (!tas5805m->dsp_cfg_data) { release_firmware(fw); return -ENOMEM; }
memcpy(tas5805m->dsp_cfg_data, fw->data, fw->size);
release_firmware(fw);
You could probably now move the release_firmware call to be immediately after the devm_kmemdup attempt, and avoid having to call it from two different places.
Cheers, Daniel
--
Daniel Beer
Firmware Engineer at Igor Institute
daniel.beer@igorinstitute.com or +64-27-420-8101
Offices in Seattle, San Francisco, and Vancouver BC or (206) 494-3312