diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2011-02-08 18:12:40 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-09 14:59:04 -0500 |
commit | ee99aa4928129d4aad9087988db6b7815ecdc1d5 (patch) | |
tree | bfb8da7c475fb9805549d6d25f6b4d1fabfc80e7 /drivers/staging/easycap | |
parent | 66681fb74e3d2f4dbf40f1e22b315a3807408eaf (diff) |
staging/easycap: remove paranoid argument checks in usb probe/disconnect
remove checks for NULL for usb_interface. USB bus won't call these
functions with NULL
Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/easycap')
-rw-r--r-- | drivers/staging/easycap/easycap_main.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/drivers/staging/easycap/easycap_main.c b/drivers/staging/easycap/easycap_main.c index 396f56b1e41..cfdbb575322 100644 --- a/drivers/staging/easycap/easycap_main.c +++ b/drivers/staging/easycap/easycap_main.c | |||
@@ -3145,7 +3145,7 @@ static const struct v4l2_file_operations v4l2_fops = { | |||
3145 | static int easycap_usb_probe(struct usb_interface *pusb_interface, | 3145 | static int easycap_usb_probe(struct usb_interface *pusb_interface, |
3146 | const struct usb_device_id *pusb_device_id) | 3146 | const struct usb_device_id *pusb_device_id) |
3147 | { | 3147 | { |
3148 | struct usb_device *pusb_device, *pusb_device1; | 3148 | struct usb_device *pusb_device; |
3149 | struct usb_host_interface *pusb_host_interface; | 3149 | struct usb_host_interface *pusb_host_interface; |
3150 | struct usb_endpoint_descriptor *pepd; | 3150 | struct usb_endpoint_descriptor *pepd; |
3151 | struct usb_interface_descriptor *pusb_interface_descriptor; | 3151 | struct usb_interface_descriptor *pusb_interface_descriptor; |
@@ -3182,32 +3182,13 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, | |||
3182 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ | 3182 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ |
3183 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ | 3183 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ |
3184 | 3184 | ||
3185 | /* setup modules params */ | ||
3186 | |||
3187 | if (NULL == pusb_interface) { | ||
3188 | SAY("ERROR: pusb_interface is NULL\n"); | ||
3189 | return -EFAULT; | ||
3190 | } | ||
3191 | /*---------------------------------------------------------------------------*/ | 3185 | /*---------------------------------------------------------------------------*/ |
3192 | /* | 3186 | /* |
3193 | * GET POINTER TO STRUCTURE usb_device | 3187 | * GET POINTER TO STRUCTURE usb_device |
3194 | */ | 3188 | */ |
3195 | /*---------------------------------------------------------------------------*/ | 3189 | /*---------------------------------------------------------------------------*/ |
3196 | pusb_device1 = container_of(pusb_interface->dev.parent, | 3190 | pusb_device = interface_to_usbdev(pusb_interface); |
3197 | struct usb_device, dev); | 3191 | |
3198 | if (NULL == pusb_device1) { | ||
3199 | SAY("ERROR: pusb_device1 is NULL\n"); | ||
3200 | return -EFAULT; | ||
3201 | } | ||
3202 | pusb_device = usb_get_dev(pusb_device1); | ||
3203 | if (NULL == pusb_device) { | ||
3204 | SAY("ERROR: pusb_device is NULL\n"); | ||
3205 | return -EFAULT; | ||
3206 | } | ||
3207 | if ((unsigned long int)pusb_device1 != (unsigned long int)pusb_device) { | ||
3208 | JOT(4, "ERROR: pusb_device1 != pusb_device\n"); | ||
3209 | return -EFAULT; | ||
3210 | } | ||
3211 | JOT(4, "bNumConfigurations=%i\n", pusb_device->descriptor.bNumConfigurations); | 3192 | JOT(4, "bNumConfigurations=%i\n", pusb_device->descriptor.bNumConfigurations); |
3212 | /*---------------------------------------------------------------------------*/ | 3193 | /*---------------------------------------------------------------------------*/ |
3213 | pusb_host_interface = pusb_interface->cur_altsetting; | 3194 | pusb_host_interface = pusb_interface->cur_altsetting; |
@@ -4568,10 +4549,6 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4568 | 4549 | ||
4569 | JOT(4, "\n"); | 4550 | JOT(4, "\n"); |
4570 | 4551 | ||
4571 | if (NULL == pusb_interface) { | ||
4572 | JOT(4, "ERROR: pusb_interface is NULL\n"); | ||
4573 | return; | ||
4574 | } | ||
4575 | pusb_host_interface = pusb_interface->cur_altsetting; | 4552 | pusb_host_interface = pusb_interface->cur_altsetting; |
4576 | if (NULL == pusb_host_interface) { | 4553 | if (NULL == pusb_host_interface) { |
4577 | JOT(4, "ERROR: pusb_host_interface is NULL\n"); | 4554 | JOT(4, "ERROR: pusb_host_interface is NULL\n"); |