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