aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/driver.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 445455a4429b..ddd820d25288 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -125,10 +125,9 @@ store_remove_id(struct device_driver *driver, const char *buf, size_t count)
125{ 125{
126 struct usb_dynid *dynid, *n; 126 struct usb_dynid *dynid, *n;
127 struct usb_driver *usb_driver = to_usb_driver(driver); 127 struct usb_driver *usb_driver = to_usb_driver(driver);
128 u32 idVendor = 0; 128 u32 idVendor;
129 u32 idProduct = 0; 129 u32 idProduct;
130 int fields = 0; 130 int fields;
131 int retval = 0;
132 131
133 fields = sscanf(buf, "%x %x", &idVendor, &idProduct); 132 fields = sscanf(buf, "%x %x", &idVendor, &idProduct);
134 if (fields < 2) 133 if (fields < 2)
@@ -141,14 +140,10 @@ store_remove_id(struct device_driver *driver, const char *buf, size_t count)
141 (id->idProduct == idProduct)) { 140 (id->idProduct == idProduct)) {
142 list_del(&dynid->node); 141 list_del(&dynid->node);
143 kfree(dynid); 142 kfree(dynid);
144 retval = 0;
145 break; 143 break;
146 } 144 }
147 } 145 }
148 spin_unlock(&usb_driver->dynids.lock); 146 spin_unlock(&usb_driver->dynids.lock);
149
150 if (retval)
151 return retval;
152 return count; 147 return count;
153} 148}
154static DRIVER_ATTR(remove_id, S_IRUGO | S_IWUSR, show_dynids, store_remove_id); 149static DRIVER_ATTR(remove_id, S_IRUGO | S_IWUSR, show_dynids, store_remove_id);