1 Nov
2011
1 Nov
'11
1:15 p.m.
On Tue, Nov 01, 2011 at 08:53:05AM +0200, Leon Romanovsky wrote:
On Mon, Oct 31, 2011 at 16:28, Girdwood, Liam lrg@ti.com wrote:
On 29 October 2011 19:42, Leon Romanovsky leon@leon.nu wrote:
- alc5632 = devm_kzalloc(&client->dev, sizeof(struct alc5632_priv), GFP_KERNEL);
- if (alc5632 == NULL)
- return -ENOMEM;
- alc5632->id = vid2;
- switch (alc5632->id) {
- case 0x5c:
- alc5632_dai.name = "alc5632-hifi";
- break;
- default:
Need to free resources here.
Do I need explicit call for this? Is this because driver detach not called in this case? http://lxr.free-electrons.com/source/drivers/base/devres.c#L609 (Memory allocated with this function is automatically freed on driver detach.)
You should be fine due to use of devm_kzalloc() - it's just that that's a relatively new API.