aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-07-19 11:12:47 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-21 13:48:15 -0400
commit6f6b90c9231ad6b18f7393e1b6c6cef9dc6aa77c (patch)
tree7cdedf6ca6d23a24681eaf54e6ab20c0682cac94 /drivers/media/rc
parent59152b1cf1182fd671dafa056cebeed95d0b1468 (diff)
[media] imon: don't parse scancodes until intf configured
The imon devices have either 1 or 2 usb interfaces on them, each wired up to its own urb callback. The interface 0 urb callback is wired up before the imon context's rc_dev pointer is filled in, which is necessary for imon 0xffdc device auto-detection to work properly, but we need to make sure we don't actually run the callback routines until we've entirely filled in the necessary bits for each given interface, lest we wind up oopsing. Technically, any imon device could have hit this, but the issue is exacerbated on the 0xffdc devices, which send a constant stream of interrupts, even when they have no valid key data. CC: Andy Walls <awalls@md.metrocast.net> CC: Chris W <lkml@psychogeeks.com> Reported-by: Chris W <lkml@psychogeeks.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/imon.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index caa3e3ac41cb..6ed96465137a 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1658,7 +1658,7 @@ static void usb_rx_callback_intf0(struct urb *urb)
1658 return; 1658 return;
1659 1659
1660 ictx = (struct imon_context *)urb->context; 1660 ictx = (struct imon_context *)urb->context;
1661 if (!ictx) 1661 if (!ictx || !ictx->dev_present_intf0)
1662 return; 1662 return;
1663 1663
1664 switch (urb->status) { 1664 switch (urb->status) {
@@ -1690,7 +1690,7 @@ static void usb_rx_callback_intf1(struct urb *urb)
1690 return; 1690 return;
1691 1691
1692 ictx = (struct imon_context *)urb->context; 1692 ictx = (struct imon_context *)urb->context;
1693 if (!ictx) 1693 if (!ictx || !ictx->dev_present_intf1)
1694 return; 1694 return;
1695 1695
1696 switch (urb->status) { 1696 switch (urb->status) {
@@ -2118,7 +2118,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
2118 2118
2119 ictx->dev = dev; 2119 ictx->dev = dev;
2120 ictx->usbdev_intf0 = usb_get_dev(interface_to_usbdev(intf)); 2120 ictx->usbdev_intf0 = usb_get_dev(interface_to_usbdev(intf));
2121 ictx->dev_present_intf0 = true;
2122 ictx->rx_urb_intf0 = rx_urb; 2121 ictx->rx_urb_intf0 = rx_urb;
2123 ictx->tx_urb = tx_urb; 2122 ictx->tx_urb = tx_urb;
2124 ictx->rf_device = false; 2123 ictx->rf_device = false;
@@ -2157,6 +2156,8 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
2157 goto rdev_setup_failed; 2156 goto rdev_setup_failed;
2158 } 2157 }
2159 2158
2159 ictx->dev_present_intf0 = true;
2160
2160 mutex_unlock(&ictx->lock); 2161 mutex_unlock(&ictx->lock);
2161 return ictx; 2162 return ictx;
2162 2163
@@ -2200,7 +2201,6 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
2200 } 2201 }
2201 2202
2202 ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf)); 2203 ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf));
2203 ictx->dev_present_intf1 = true;
2204 ictx->rx_urb_intf1 = rx_urb; 2204 ictx->rx_urb_intf1 = rx_urb;
2205 2205
2206 ret = -ENODEV; 2206 ret = -ENODEV;
@@ -2229,6 +2229,8 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
2229 goto urb_submit_failed; 2229 goto urb_submit_failed;
2230 } 2230 }
2231 2231
2232 ictx->dev_present_intf1 = true;
2233
2232 mutex_unlock(&ictx->lock); 2234 mutex_unlock(&ictx->lock);
2233 return ictx; 2235 return ictx;
2234 2236