Skip to contentSkip to conversation

usb: core: endpoint: Fix error path

PATCH In review Rahul Ruikar 1 participant 2 messages Oct 7, 2010 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: core: endpoint: Fix error path

In function usb_create_ep_devs()
call put_device() when device_register() fails.

---
 drivers/usb/core/endpoint.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/core/endpoint.c +1 -1
index 3788e73..9da2505 100644
@@ -202,7 +202,7 @@ int usb_create_ep_devs(struct device *parent,
 	return retval;
 
 error_register:
-	kfree(ep_dev);
+	put_device(&ep_dev->dev);
 exit:
 	return retval;
 }
Signature · 1 line
1.7.2.3
#1 lore raw

Greg,

Kindly include this patch.

- Rahul Ruikar

Quoted 25 lines · Rahul Ruikar

In function usb_create_ep_devs()
call put_device() when device_register() fails.

---
 drivers/usb/core/endpoint.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/core/endpoint.c +0 -0
index 3788e73..9da2505 100644
@@ -202,7 +202,7 @@ int usb_create_ep_devs(struct device *parent,
        return retval;
 

 error_register:
-       kfree(ep_dev);
+       put_device(&ep_dev->dev);
 exit:
       return retval;
 }
--
1.7.2.3