Re: [PATCH] ASoC: codecs: Use sizeof(struct) for aw_container allocation

From: Mark Brown

Date: Mon Jun 01 2026 - 13:49:13 EST


On Mon, Jun 01, 2026 at 03:25:53PM +0800, wangdich9700@xxxxxxx wrote:

> - aw88081->aw_cfg = devm_kzalloc(aw88081->aw_pa->dev, cont->size + sizeof(int), GFP_KERNEL);
> + aw88081->aw_cfg = devm_kzalloc(aw88081->aw_pa->dev,
> + sizeof(struct aw_container) + cont->size,
> + GFP_KERNEL);

We have a bunch of helper macros like struct_size() for this stuff.

Attachment: signature.asc
Description: PGP signature