Input: imx_sc_key - Fix memory corruption on unload
Subsystems (4)
PATCH 1/1 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 &.
--- drivers/input/keyboard/imx_sc_key.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/keyboard/imx_sc_key.c +1 -1
@@ -158,7 +158,7 @@ static int imx_sc_key_probe(struct platform_device *pdev)return error; } - error =devm_add_action_or_reset (&pdev->dev, imx_sc_key_action, &priv); + error =devm_add_action_or_reset (&pdev->dev, imx_sc_key_action, priv);if (error)return error;
Signature · 1 line
2.51.0
Quoted 6 lines · Dan Carpenter
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 <[email protected]>
Quoted 20 lines
--- drivers/input/keyboard/imx_sc_key.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/input/keyboard/imx_sc_key.c +1
-2@@ -158,7 +158,7 @@ static int imx_sc_key_probe(struct platform_device *pdev)return error; } - error =devm_add_action_or_reset (&pdev->dev, imx_sc_key_action, &priv); + error =devm_add_action_or_reset (&pdev->dev, imx_sc_key_action, priv);if (error)return error; --2.51.0
Quoted 6 lines · Dan Carpenter
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 <[email protected]>
Thanks for the fix.
Quoted 6 lines · Dan Carpenter
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 <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry