]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: qcom-adm: fix wrong sizeof config in slave_config
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 15 Sep 2022 20:48:44 +0000 (22:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:56:47 +0000 (09:56 +0200)
commitf1dd45a6585a1689e1e8906b3f9e302b9d40c715
tree712abe866dd4fa2c869268f3964313afadb11b8c
parent94e002aec4663b60bf177d6571674c19a28385cc
dmaengine: qcom-adm: fix wrong sizeof config in slave_config

commit 7c8765308371be30f50c1b5b97618b731514b207 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/qcom/qcom_adm.c