diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-28 22:43:25 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 22:58:58 +0400 |
commit | 4d42e1bb9e8ec7eb5e39d82aaf3ff2f3c994af84 (patch) | |
tree | 1316e32df6772e99221a9b88cbcc6f60abfc3f54 /drivers/usb/misc/cytherm.c | |
parent | 1b21d5e166e104f8914441ef52e2cd50ce65b479 (diff) | |
download | linux-4d42e1bb9e8ec7eb5e39d82aaf3ff2f3c994af84.tar.xz |
USB: fix __must_check warnings in drivers/usb/misc/
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/cytherm.c')
-rw-r--r-- | drivers/usb/misc/cytherm.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index b20bec445552..04e87acd6e46 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c @@ -353,7 +353,7 @@ static int cytherm_probe(struct usb_interface *interface, dev = kzalloc (sizeof(struct usb_cytherm), GFP_KERNEL); if (dev == NULL) { dev_err (&interface->dev, "Out of memory\n"); - goto error; + goto error_mem; } dev->udev = usb_get_dev(udev); @@ -362,18 +362,35 @@ static int cytherm_probe(struct usb_interface *interface, dev->brightness = 0xFF; - device_create_file(&interface->dev, &dev_attr_brightness); - device_create_file(&interface->dev, &dev_attr_temp); - device_create_file(&interface->dev, &dev_attr_button); - device_create_file(&interface->dev, &dev_attr_port0); - device_create_file(&interface->dev, &dev_attr_port1); + retval = device_create_file(&interface->dev, &dev_attr_brightness); + if (retval) + goto error; + retval = device_create_file(&interface->dev, &dev_attr_temp); + if (retval) + goto error; + retval = device_create_file(&interface->dev, &dev_attr_button); + if (retval) + goto error; + 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; - dev_info (&interface->dev, + dev_info (&interface->dev, "Cypress thermometer device now attached\n"); return 0; - - error: +error: + device_remove_file(&interface->dev, &dev_attr_brightness); + device_remove_file(&interface->dev, &dev_attr_temp); + device_remove_file(&interface->dev, &dev_attr_button); + 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; } |