summaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-09-15 22:48:44 +0200
committerVinod Koul <vkoul@kernel.org>2022-09-29 22:46:07 +0530
commit7c8765308371be30f50c1b5b97618b731514b207 (patch)
tree30331dd20519eb2e98d89b0cb9b0db84fed76e69 /drivers/dma
parent693e9c269e8e8fb16f1d7fac38bd774402722e87 (diff)
downloadlinux-stable-7c8765308371be30f50c1b5b97618b731514b207.tar.gz
linux-stable-7c8765308371be30f50c1b5b97618b731514b207.tar.bz2
linux-stable-7c8765308371be30f50c1b5b97618b731514b207.zip
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: 03de6b273805 ("dmaengine: qcom-adm: stop abusing slave_id config") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Cc: stable@vger.kernel.org # v5.17+ Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20220915204844.3838-1-ansuelsmth@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/qcom/qcom_adm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/qcom/qcom_adm.c b/drivers/dma/qcom/qcom_adm.c
index facdacf8aede..c77d9de853de 100644
--- a/drivers/dma/qcom/qcom_adm.c
+++ b/drivers/dma/qcom/qcom_adm.c
@@ -494,7 +494,7 @@ static int adm_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)
spin_lock_irqsave(&achan->vc.lock, flag);
memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config));
- if (cfg->peripheral_size == sizeof(config))
+ if (cfg->peripheral_size == sizeof(*config))
achan->crci = config->crci;
spin_unlock_irqrestore(&achan->vc.lock, flag);