Skip to content

probe: zero-initialize DMA config in probe_dma_init() - #11474

Open
ursus161 wants to merge 1 commit into
thesofproject:mainfrom
ursus161:probe-dma-cfg-init
Open

ursus161 wants to merge 1 commit into
thesofproject:mainfrom
ursus161:probe-dma-cfg-init

Conversation

@ursus161

Copy link
Copy Markdown

dma_cfg and dma_block_cfg are only partly filled before dma_config(), so the remaining fields (callback, burst lengths, next_block, ...) hold stack garbage. Zero-initialize both structs.

@sofci

sofci commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

reply test this please to run this test once

Comment thread src/kernel/probe/probe.c
@@ -195,8 +195,8 @@ __cold static int probe_dma_init(struct probe_dma_ext *dma, uint32_t direction)
{
uint32_t addr_align;

@dbaluta dbaluta Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but please wrap the commit message at around 100 chars or so.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@dbaluta

dbaluta commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

reply test this please to run this test once

test this please

dma_cfg and dma_block_cfg are only partly filled in before
dma_config() is called, so the remaining fields (callback, burst
lengths, next_block, ...) hold stack garbage. Zero-initialize both
structs.

Signed-off-by: Stefan Ghetu <stefan.ghetu@nxp.com>
@dbaluta

dbaluta commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

LGTM now, @lyakh @lgirdwood please have a quick look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants