diff options
Diffstat (limited to 'drivers/usb/class/cdc-wdm.c')
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 65a55abb791f..5f0cb417b736 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -109,12 +109,14 @@ static struct usb_driver wdm_driver; | |||
109 | /* return intfdata if we own the interface, else look up intf in the list */ | 109 | /* return intfdata if we own the interface, else look up intf in the list */ |
110 | static struct wdm_device *wdm_find_device(struct usb_interface *intf) | 110 | static struct wdm_device *wdm_find_device(struct usb_interface *intf) |
111 | { | 111 | { |
112 | struct wdm_device *desc = NULL; | 112 | struct wdm_device *desc; |
113 | 113 | ||
114 | spin_lock(&wdm_device_list_lock); | 114 | spin_lock(&wdm_device_list_lock); |
115 | list_for_each_entry(desc, &wdm_device_list, device_list) | 115 | list_for_each_entry(desc, &wdm_device_list, device_list) |
116 | if (desc->intf == intf) | 116 | if (desc->intf == intf) |
117 | break; | 117 | goto found; |
118 | desc = NULL; | ||
119 | found: | ||
118 | spin_unlock(&wdm_device_list_lock); | 120 | spin_unlock(&wdm_device_list_lock); |
119 | 121 | ||
120 | return desc; | 122 | return desc; |
@@ -122,12 +124,14 @@ static struct wdm_device *wdm_find_device(struct usb_interface *intf) | |||
122 | 124 | ||
123 | static struct wdm_device *wdm_find_device_by_minor(int minor) | 125 | static struct wdm_device *wdm_find_device_by_minor(int minor) |
124 | { | 126 | { |
125 | struct wdm_device *desc = NULL; | 127 | struct wdm_device *desc; |
126 | 128 | ||
127 | spin_lock(&wdm_device_list_lock); | 129 | spin_lock(&wdm_device_list_lock); |
128 | list_for_each_entry(desc, &wdm_device_list, device_list) | 130 | list_for_each_entry(desc, &wdm_device_list, device_list) |
129 | if (desc->intf->minor == minor) | 131 | if (desc->intf->minor == minor) |
130 | break; | 132 | goto found; |
133 | desc = NULL; | ||
134 | found: | ||
131 | spin_unlock(&wdm_device_list_lock); | 135 | spin_unlock(&wdm_device_list_lock); |
132 | 136 | ||
133 | return desc; | 137 | return desc; |