007-hso-Earlier-catch-of-error-condition.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 35e57e1b49a351aa804dab6010cd46ae6112a541 Mon Sep 17 00:00:00 2001
  2. From: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
  3. Date: Wed, 21 Aug 2013 01:43:07 -0700
  4. Subject: [PATCH 1/2] hso: Earlier catch of error condition
  5. There is no need to get an interface specification if we know it's the
  6. wrong one.
  7. Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
  8. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  9. Signed-off-by: David S. Miller <davem@davemloft.net>
  10. ---
  11. drivers/net/usb/hso.c | 9 +++++----
  12. 1 file changed, 5 insertions(+), 4 deletions(-)
  13. --- a/drivers/net/usb/hso.c
  14. +++ b/drivers/net/usb/hso.c
  15. @@ -2908,6 +2908,11 @@ static int hso_probe(struct usb_interfac
  16. struct hso_shared_int *shared_int;
  17. struct hso_device *tmp_dev = NULL;
  18. + if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
  19. + dev_err(&interface->dev, "Not our interface\n");
  20. + return -ENODEV;
  21. + }
  22. +
  23. if_num = interface->altsetting->desc.bInterfaceNumber;
  24. /* Get the interface/port specification from either driver_info or from
  25. @@ -2917,10 +2922,6 @@ static int hso_probe(struct usb_interfac
  26. else
  27. port_spec = hso_get_config_data(interface);
  28. - if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
  29. - dev_err(&interface->dev, "Not our interface\n");
  30. - return -ENODEV;
  31. - }
  32. /* Check if we need to switch to alt interfaces prior to port
  33. * configuration */
  34. if (interface->num_altsetting > 1)