summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/cypress_cy7c63.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-08-28 11:43:25 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 11:58:58 -0700
commit4d42e1bb9e8ec7eb5e39d82aaf3ff2f3c994af84 (patch)
tree1316e32df6772e99221a9b88cbcc6f60abfc3f54 /drivers/usb/misc/cypress_cy7c63.c
parent1b21d5e166e104f8914441ef52e2cd50ce65b479 (diff)
USB: fix __must_check warnings in drivers/usb/misc/
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/cypress_cy7c63.c')
-rw-r--r--drivers/usb/misc/cypress_cy7c63.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c
index 9c46746d5d00..b63b5f34b2aa 100644
--- a/drivers/usb/misc/cypress_cy7c63.c
+++ b/drivers/usb/misc/cypress_cy7c63.c
@@ -209,7 +209,7 @@ static int cypress_probe(struct usb_interface *interface,
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
dev_err(&interface->dev, "Out of memory!\n");
- goto error;
+ goto error_mem;
}
dev->udev = usb_get_dev(interface_to_usbdev(interface));
@@ -218,15 +218,26 @@ static int cypress_probe(struct usb_interface *interface,
usb_set_intfdata(interface, dev);
/* create device attribute files */
- device_create_file(&interface->dev, &dev_attr_port0);
- device_create_file(&interface->dev, &dev_attr_port1);
+ retval = device_create_file(&interface->dev, &dev_attr_port0);
+ if (retval)
+ goto error;
+ retval = device_create_file(&interface->dev, &dev_attr_port1);
+ if (retval)
+ goto error;
/* let the user know that the device is now attached */
dev_info(&interface->dev,
"Cypress CY7C63xxx device now attached\n");
+ return 0;
- retval = 0;
error:
+ device_remove_file(&interface->dev, &dev_attr_port0);
+ device_remove_file(&interface->dev, &dev_attr_port1);
+ usb_set_intfdata(interface, NULL);
+ usb_put_dev(dev->udev);
+ kfree(dev);
+
+error_mem:
return retval;
}