diff options
| author | Rosen Penev <rosenp@gmail.com> | 2026-05-18 17:46:47 -0700 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-05-19 08:02:52 +0200 |
| commit | 2c515c221a7a2fd0dcb335b9866a98d0bedd9ca5 (patch) | |
| tree | 71c0b400b0dce62238ca8b33764235c77ef7d0ae | |
| parent | 1ab8e422dc779a91acba2d0aafc47b0db6680b4b (diff) | |
| download | linux-next-history-2c515c221a7a2fd0dcb335b9866a98d0bedd9ca5.tar.gz | |
ALSA: oss: Use flexible allocation for PCM plugins
Allocate PCM plugin objects with kzalloc_flex() for the trailing
extra data area instead of open-coding the size calculation.
This keeps the allocation tied to the existing flexible array member
without changing the plugin lifetime.
Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20260519004647.627429-1-rosenp@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | sound/core/oss/pcm_plugin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 14b4a390a2192..5f4d6945a7df6 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -146,7 +146,7 @@ int snd_pcm_plugin_build(struct snd_pcm_substream *plug, return -ENXIO; if (snd_BUG_ON(!src_format || !dst_format)) return -ENXIO; - plugin = kzalloc(sizeof(*plugin) + extra, GFP_KERNEL); + plugin = kzalloc_flex(*plugin, extra_data, extra); if (plugin == NULL) return -ENOMEM; plugin->name = name; |
