]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Input: imx_sc_key - fix memory corruption on unload
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 1 Nov 2025 13:25:27 +0000 (16:25 +0300)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 4 Nov 2025 18:57:36 +0000 (10:57 -0800)
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>
drivers/input/keyboard/imx_sc_key.c

index d18839f1f4f60dedb52f1b77fd9337ad724faa5d..b620cd310cdb784de1438e571d3c8db004aecb2c 100644 (file)
@@ -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;