Skip to content

Commit

Permalink
[media] rc: ite-cir: Initialise ite_dev::rdev earlier
Browse files Browse the repository at this point in the history
ite_dev::rdev is currently initialised in ite_probe() after
rc_register_device() returns.  If a newly registered device is opened
quickly enough, we may enable interrupts and try to use ite_dev::rdev
before it has been initialised.  Move it up to the earliest point we
can, right after calling rc_allocate_device().

Reported-and-tested-by: YunQiang Su <wzssyqa@gmail.com>

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Ben Hutchings authored and Mauro Carvalho Chehab committed Sep 14, 2012
1 parent 612cd9e commit 4b96118
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/rc/ite-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
rdev = rc_allocate_device();
if (!rdev)
goto failure;
itdev->rdev = rdev;

ret = -ENODEV;

Expand Down Expand Up @@ -1604,7 +1605,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
if (ret)
goto failure3;

itdev->rdev = rdev;
ite_pr(KERN_NOTICE, "driver has been successfully loaded\n");

return 0;
Expand Down

0 comments on commit 4b96118

Please sign in to comment.