diff options
author | Jarod Wilson <jarod@redhat.com> | 2011-01-06 14:59:34 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-19 08:45:51 -0500 |
commit | 9ad77eb57b45f81ac3e12077d19e5f121c4cff6d (patch) | |
tree | 238a30b269d3d452c74623e55aa4c08fe806e2c6 /drivers/media/rc/imon.c | |
parent | 2e4c55626a0c30b5b2bc9469c025a563a81c3785 (diff) |
[media] rc/imon: need to submit urb before ffdc type check
Otherwise, we have a null receive buffer, and the logic all falls down,
goes boom, all ffdc devs wind up as imon IR w/VFD. Oops.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/imon.c')
-rw-r--r-- | drivers/media/rc/imon.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index a30bd99c5ca4..703420749243 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c | |||
@@ -2110,18 +2110,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
2110 | goto find_endpoint_failed; | 2110 | goto find_endpoint_failed; |
2111 | } | 2111 | } |
2112 | 2112 | ||
2113 | ictx->idev = imon_init_idev(ictx); | ||
2114 | if (!ictx->idev) { | ||
2115 | dev_err(dev, "%s: input device setup failed\n", __func__); | ||
2116 | goto idev_setup_failed; | ||
2117 | } | ||
2118 | |||
2119 | ictx->rdev = imon_init_rdev(ictx); | ||
2120 | if (!ictx->rdev) { | ||
2121 | dev_err(dev, "%s: rc device setup failed\n", __func__); | ||
2122 | goto rdev_setup_failed; | ||
2123 | } | ||
2124 | |||
2125 | usb_fill_int_urb(ictx->rx_urb_intf0, ictx->usbdev_intf0, | 2113 | usb_fill_int_urb(ictx->rx_urb_intf0, ictx->usbdev_intf0, |
2126 | usb_rcvintpipe(ictx->usbdev_intf0, | 2114 | usb_rcvintpipe(ictx->usbdev_intf0, |
2127 | ictx->rx_endpoint_intf0->bEndpointAddress), | 2115 | ictx->rx_endpoint_intf0->bEndpointAddress), |
@@ -2135,13 +2123,25 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
2135 | goto urb_submit_failed; | 2123 | goto urb_submit_failed; |
2136 | } | 2124 | } |
2137 | 2125 | ||
2126 | ictx->idev = imon_init_idev(ictx); | ||
2127 | if (!ictx->idev) { | ||
2128 | dev_err(dev, "%s: input device setup failed\n", __func__); | ||
2129 | goto idev_setup_failed; | ||
2130 | } | ||
2131 | |||
2132 | ictx->rdev = imon_init_rdev(ictx); | ||
2133 | if (!ictx->rdev) { | ||
2134 | dev_err(dev, "%s: rc device setup failed\n", __func__); | ||
2135 | goto rdev_setup_failed; | ||
2136 | } | ||
2137 | |||
2138 | return ictx; | 2138 | return ictx; |
2139 | 2139 | ||
2140 | urb_submit_failed: | ||
2141 | rc_unregister_device(ictx->rdev); | ||
2142 | rdev_setup_failed: | 2140 | rdev_setup_failed: |
2143 | input_unregister_device(ictx->idev); | 2141 | input_unregister_device(ictx->idev); |
2144 | idev_setup_failed: | 2142 | idev_setup_failed: |
2143 | usb_kill_urb(ictx->rx_urb_intf0); | ||
2144 | urb_submit_failed: | ||
2145 | find_endpoint_failed: | 2145 | find_endpoint_failed: |
2146 | mutex_unlock(&ictx->lock); | 2146 | mutex_unlock(&ictx->lock); |
2147 | usb_free_urb(tx_urb); | 2147 | usb_free_urb(tx_urb); |