Skip to content

Commit 7c87653

Browse files
Ansuelvinodkoul
authored andcommitted
dmaengine: qcom-adm: fix wrong sizeof config in slave_config
Fix broken slave_config function that uncorrectly compare the peripheral_size with the size of the config pointer instead of the size of the config struct. This cause the crci value to be ignored and cause a kernel panic on any slave that use adm driver. To fix this, compare to the size of the struct and NOT the size of the pointer. Fixes: 03de6b2 ("dmaengine: qcom-adm: stop abusing slave_id config") Signed-off-by: Christian Marangi <[email protected]> Cc: [email protected] # v5.17+ Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 693e9c2 commit 7c87653

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/qcom/qcom_adm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ static int adm_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)
494494

495495
spin_lock_irqsave(&achan->vc.lock, flag);
496496
memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config));
497-
if (cfg->peripheral_size == sizeof(config))
497+
if (cfg->peripheral_size == sizeof(*config))
498498
achan->crci = config->crci;
499499
spin_unlock_irqrestore(&achan->vc.lock, flag);
500500

0 commit comments

Comments
 (0)