summaryrefslogtreecommitdiff
path: root/drivers/usb/input/yealink.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-05-03 04:57:29 (GMT)
committerDmitry Torokhov <dtor@insightbb.com>2007-05-03 04:57:29 (GMT)
commite37a97d44038700ff8c2f1080f71fdfc3a4c0c1e (patch)
treec78b612f6cca1efd305743c4bdce237f06975965 /drivers/usb/input/yealink.c
parent4bdd488f4bf7dc91b371fe160a4718b0a91bb2a4 (diff)
downloadlinux-e37a97d44038700ff8c2f1080f71fdfc3a4c0c1e.tar.xz
Input: drivers/usb/input - usb_buffer_free() cleanup
usb_buffer_free() now handles NULLs so remove unneeded checks form callers. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb/input/yealink.c')
-rw-r--r--drivers/usb/input/yealink.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c
index c54f1a5..fc645b2 100644
--- a/drivers/usb/input/yealink.c
+++ b/drivers/usb/input/yealink.c
@@ -818,18 +818,17 @@ static int usb_cleanup(struct yealink_dev *yld, int err)
else
input_unregister_device(yld->idev);
}
- if (yld->ctl_req)
- usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
- yld->ctl_req, yld->ctl_req_dma);
- if (yld->ctl_data)
- usb_buffer_free(yld->udev, USB_PKT_LEN,
- yld->ctl_data, yld->ctl_dma);
- if (yld->irq_data)
- usb_buffer_free(yld->udev, USB_PKT_LEN,
- yld->irq_data, yld->irq_dma);
-
- usb_free_urb(yld->urb_irq); /* parameter validation in core/urb */
- usb_free_urb(yld->urb_ctl); /* parameter validation in core/urb */
+
+ usb_free_urb(yld->urb_irq);
+ usb_free_urb(yld->urb_ctl);
+
+ usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)),
+ yld->ctl_req, yld->ctl_req_dma);
+ usb_buffer_free(yld->udev, USB_PKT_LEN,
+ yld->ctl_data, yld->ctl_dma);
+ usb_buffer_free(yld->udev, USB_PKT_LEN,
+ yld->irq_data, yld->irq_dma);
+
kfree(yld);
return err;
}