diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-28 14:43:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 14:58:58 -0400 |
commit | 4d42e1bb9e8ec7eb5e39d82aaf3ff2f3c994af84 (patch) | |
tree | 1316e32df6772e99221a9b88cbcc6f60abfc3f54 /drivers/usb/misc/usbled.c | |
parent | 1b21d5e166e104f8914441ef52e2cd50ce65b479 (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/usbled.c')
-rw-r--r-- | drivers/usb/misc/usbled.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c index 0c5ee0ad6bb9..49c5c5c4c431 100644 --- a/drivers/usb/misc/usbled.c +++ b/drivers/usb/misc/usbled.c | |||
@@ -108,22 +108,34 @@ static int led_probe(struct usb_interface *interface, const struct usb_device_id | |||
108 | dev = kzalloc(sizeof(struct usb_led), GFP_KERNEL); | 108 | dev = kzalloc(sizeof(struct usb_led), GFP_KERNEL); |
109 | if (dev == NULL) { | 109 | if (dev == NULL) { |
110 | dev_err(&interface->dev, "Out of memory\n"); | 110 | dev_err(&interface->dev, "Out of memory\n"); |
111 | goto error; | 111 | goto error_mem; |
112 | } | 112 | } |
113 | 113 | ||
114 | dev->udev = usb_get_dev(udev); | 114 | dev->udev = usb_get_dev(udev); |
115 | 115 | ||
116 | usb_set_intfdata (interface, dev); | 116 | usb_set_intfdata (interface, dev); |
117 | 117 | ||
118 | device_create_file(&interface->dev, &dev_attr_blue); | 118 | retval = device_create_file(&interface->dev, &dev_attr_blue); |
119 | device_create_file(&interface->dev, &dev_attr_red); | 119 | if (retval) |
120 | device_create_file(&interface->dev, &dev_attr_green); | 120 | goto error; |
121 | retval = device_create_file(&interface->dev, &dev_attr_red); | ||
122 | if (retval) | ||
123 | goto error; | ||
124 | retval = device_create_file(&interface->dev, &dev_attr_green); | ||
125 | if (retval) | ||
126 | goto error; | ||
121 | 127 | ||
122 | dev_info(&interface->dev, "USB LED device now attached\n"); | 128 | dev_info(&interface->dev, "USB LED device now attached\n"); |
123 | return 0; | 129 | return 0; |
124 | 130 | ||
125 | error: | 131 | error: |
132 | device_remove_file(&interface->dev, &dev_attr_blue); | ||
133 | device_remove_file(&interface->dev, &dev_attr_red); | ||
134 | device_remove_file(&interface->dev, &dev_attr_green); | ||
135 | usb_set_intfdata (interface, NULL); | ||
136 | usb_put_dev(dev->udev); | ||
126 | kfree(dev); | 137 | kfree(dev); |
138 | error_mem: | ||
127 | return retval; | 139 | return retval; |
128 | } | 140 | } |
129 | 141 | ||