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
6 commit 35e57e1b49a351aa804dab6010cd46ae6112a541 upstream.
8 There is no need to get an interface specification if we know it's the
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>
15 drivers/net/usb/hso.c | 9 +++++----
16 1 file changed, 5 insertions(+), 4 deletions(-)
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;
24 + if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
25 + dev_err(&interface->dev, "Not our interface\n");
29 if_num = interface->altsetting->desc.bInterfaceNumber;
31 /* Get the interface/port specification from either driver_info or from
32 @@ -2895,10 +2900,6 @@ static int hso_probe(struct usb_interfac
34 port_spec = hso_get_config_data(interface);
36 - if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
37 - dev_err(&interface->dev, "Not our interface\n");
40 /* Check if we need to switch to alt interfaces prior to port
42 if (interface->num_altsetting > 1)