summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-01-17 08:09:31 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-01-17 08:19:40 +0100
commitec87da107d11521123beaa9f8e4869c6f54e8df8 (patch)
tree65852d4baf194e6ff4c2c26e4c301bda0e5464b1
parentInput: uinput - fix undefined behavior in uinput_validate_absinfo() (diff)
downloadlinux-ec87da107d11521123beaa9f8e4869c6f54e8df8.tar.xz
linux-ec87da107d11521123beaa9f8e4869c6f54e8df8.zip
Input: olpc_apsp - assign priv->dev earlier
The dev field needs to be set when serio_register_port() is called, because the open callback may use it (in the error handling path). Fixes: commit af518342effd ("Input: olpc_apsp - check FIFO status on open(), not probe()") Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/serio/olpc_apsp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
index b36084710f69..bae08226e3d9 100644
--- a/drivers/input/serio/olpc_apsp.c
+++ b/drivers/input/serio/olpc_apsp.c
@@ -195,6 +195,8 @@ static int olpc_apsp_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
+ priv->dev = &pdev->dev;
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->base)) {
@@ -248,7 +250,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
goto err_irq;
}
- priv->dev = &pdev->dev;
device_init_wakeup(priv->dev, 1);
platform_set_drvdata(pdev, priv);