diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2012-11-02 08:13:55 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-12-21 15:26:10 -0500 |
commit | d62b6818477704683d00c680335eff5833bd3906 (patch) | |
tree | eabe4461b28170fddc8f40e1919d9c6505dcb942 /drivers/media/rc/nuvoton-cir.c | |
parent | 70ef69915b1fba4ad85aebe530caf156a144c2e5 (diff) |
[media] rc: Set rdev before irq setup
This fixes a problem in fintek-cir and nuvoton-cir where the
irq handler would trigger during module load before the rdev member was
set, causing a NULL pointer crash.
It seems this crash is very reproducible (just bombard the receiver with
IR signals during module load), probably because when request_irq is
called, any pending intterupt is handled immediately, before
request_irq returns and rdev can be set.
This same crash was supposed to be fixed by commit
9ef449c6b31bb6a8e6dedc24de475a3b8c79be20 ("[media] rc: Postpone ISR
registration"), but the crash was still observed on the nuvoton-cir
driver.
This commit was tested on nuvoton-cir only.
Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/nuvoton-cir.c')
-rw-r--r-- | drivers/media/rc/nuvoton-cir.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 3477e231c182..c6441e690dd4 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
@@ -1065,6 +1065,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1065 | /* tx bits */ | 1065 | /* tx bits */ |
1066 | rdev->tx_resolution = XYZ; | 1066 | rdev->tx_resolution = XYZ; |
1067 | #endif | 1067 | #endif |
1068 | nvt->rdev = rdev; | ||
1068 | 1069 | ||
1069 | ret = -EBUSY; | 1070 | ret = -EBUSY; |
1070 | /* now claim resources */ | 1071 | /* now claim resources */ |
@@ -1089,7 +1090,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1089 | goto exit_free_wake_irq; | 1090 | goto exit_free_wake_irq; |
1090 | 1091 | ||
1091 | device_init_wakeup(&pdev->dev, true); | 1092 | device_init_wakeup(&pdev->dev, true); |
1092 | nvt->rdev = rdev; | 1093 | |
1093 | nvt_pr(KERN_NOTICE, "driver has been successfully loaded\n"); | 1094 | nvt_pr(KERN_NOTICE, "driver has been successfully loaded\n"); |
1094 | if (debug) { | 1095 | if (debug) { |
1095 | cir_dump_regs(nvt); | 1096 | cir_dump_regs(nvt); |