From: Alban Bedel Date: Tue, 10 Mar 2015 11:19:45 +0000 (+0530) Subject: tegra: ictlr: fix crash when an IRQ fire during the probe X-Git-Tag: tegra-l4t-r21.4~85 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/nv-tegra/linux-3.10.git/commitdiff_plain/26e3266cbe9afd36f724282bdc6c1b5525ef33f2 tegra: ictlr: fix crash when an IRQ fire during the probe The IRQ handler use drvdata, however drvdata was set *after* registering the IRQ handler. If an IRQ fired before drvdata was set it would crash the kernel. Fix this by setting drvdata before registering the IRQ handler. Bug 200081502 Change-Id: Id8578b2446b167d2b3131bc6f28820fc6f5d9e11 Signed-off-by: Alban Bedel Signed-off-by: Bibek Basu Reviewed-on: http://git-master/r/715722 GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty --- diff --git a/drivers/platform/tegra/hier_ictlr/hier_ictlr.c b/drivers/platform/tegra/hier_ictlr/hier_ictlr.c index 1859d979588..dbc65d691de 100644 --- a/drivers/platform/tegra/hier_ictlr/hier_ictlr.c +++ b/drivers/platform/tegra/hier_ictlr/hier_ictlr.c @@ -160,6 +160,8 @@ static int tegra_hier_ictlr_probe(struct platform_device *pdev) if (!ictlr) return -ENOMEM; + dev_set_drvdata(&pdev->dev, ictlr); + ret = tegra_hier_ictlr_map_memory(pdev, ictlr); if (ret) return ret; @@ -176,7 +178,6 @@ static int tegra_hier_ictlr_probe(struct platform_device *pdev) dev_notice(&pdev->dev, "probed\n"); - dev_set_drvdata(&pdev->dev, ictlr); return 0; }