kernel: update 3.18 to 3.18.1
[openwrt.git] / target / linux / generic / patches-3.3 / 007-hso-Earlier-catch-of-error-condition.patch
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
6 There is no need to get an interface specification if we know it's the
7 wrong one.
8
9 Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
10 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13  drivers/net/usb/hso.c |    9 +++++----
14  1 file changed, 5 insertions(+), 4 deletions(-)
15
16 --- a/drivers/net/usb/hso.c
17 +++ b/drivers/net/usb/hso.c
18 @@ -2927,6 +2927,11 @@ static int hso_probe(struct usb_interfac
19         struct hso_shared_int *shared_int;
20         struct hso_device *tmp_dev = NULL;
21  
22 +       if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
23 +               dev_err(&interface->dev, "Not our interface\n");
24 +               return -ENODEV;
25 +       }
26 +
27         if_num = interface->altsetting->desc.bInterfaceNumber;
28  
29         /* Get the interface/port specification from either driver_info or from
30 @@ -2936,10 +2941,6 @@ static int hso_probe(struct usb_interfac
31         else
32                 port_spec = hso_get_config_data(interface);
33  
34 -       if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
35 -               dev_err(&interface->dev, "Not our interface\n");
36 -               return -ENODEV;
37 -       }
38         /* Check if we need to switch to alt interfaces prior to port
39          * configuration */
40         if (interface->num_altsetting > 1)