linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] rc: ite-cir: Initialise ite_dev::rdev earlier
@ 2012-08-19 21:24 Ben Hutchings
  2012-08-19 23:32 ` [PATCH v2] " Ben Hutchings
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Hutchings @ 2012-08-19 21:24 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: YunQiang Su, 684441, Jarod Wilson, linux-media, Luis Henriques

[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]

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().

References: http://bugs.debian.org/684441
Reported-and-tested-by: YunQiang Su <wzssyqa@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org
---
 drivers/media/rc/ite-cir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 0e49c99..c06992e 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -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;
 
@@ -1604,7 +1605,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
 	if (ret)
 		goto failure;
 
-	itdev->rdev = rdev;
 	ite_pr(KERN_NOTICE, "driver has been successfully loaded\n");
 
 	return 0;


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-09-16  4:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-19 21:24 [PATCH] [media] rc: ite-cir: Initialise ite_dev::rdev earlier Ben Hutchings
2012-08-19 23:32 ` [PATCH v2] " Ben Hutchings
2012-08-28  1:37   ` YunQiang Su
2012-08-28 11:44   ` Luis Henriques
2012-08-28 17:09     ` Ben Hutchings
2012-08-28 20:48       ` Luis Henriques
2012-09-16  4:56         ` YunQiang Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).