Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: imx_sc_key - fix memory corruption on unload

This is supposed to be "priv" but we accidentally pass "&priv" which is
an address in the stack and so it will lead to memory corruption when
the imx_sc_key_action() function is called. Remove the &.

Fixes: 768062fd1284 ("Input: imx_sc_key - use devm_add_action_or_reset() to handle all cleanups")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/aQYKR75r2VMFJutT@stanley.mountain
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Dan Carpenter and committed by
Dmitry Torokhov
d83f1512 69aeb507

+1 -1
+1 -1
drivers/input/keyboard/imx_sc_key.c
··· 158 158 return error; 159 159 } 160 160 161 - error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, &priv); 161 + error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, priv); 162 162 if (error) 163 163 return error; 164 164