Skip to content

Commit

Permalink
[media] tm6000: Don't try to use a non-existing interface
Browse files Browse the repository at this point in the history
> [34883.426065] tm6000 #0: registered device video0
> [34883.430591] Trident TVMaster TM5600/TM6000/TM6010 USB2 board (Load status: 0)
> [34883.437763] usbcore: registered new interface driver tm6000
> [34884.608372] BUG: unable to handle kernel NULL pointer dereference at 00000002
> [34884.615514] IP: [<f8c4ceea>] tm6000_reset+0xd7/0x11c [tm6000]

The dev->int_in USB interfaces is used by some devices for the
Remote Controller. Not all devices seem to define this interface,
so, tm6000_reset should not try to set the interface to it on
such devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Sep 1, 2011
1 parent d657229 commit f8dbab2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/staging/tm6000/tm6000-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,12 @@ int tm6000_reset(struct tm6000_core *dev)

msleep(5);

/*
* Not all devices have int_in defined
*/
if (!dev->int_in.endp)
return 0;

err = usb_set_interface(dev->udev, dev->isoc_in.bInterfaceNumber, 2);
if (err < 0) {
tm6000_err("failed to select interface %d, alt. setting 2\n",
Expand Down

0 comments on commit f8dbab2

Please sign in to comment.