diff options
author | Pavankumar Kondeti <pkondeti@codeaurora.org> | 2010-12-16 14:32:25 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 15:45:44 -0800 |
commit | daba58035a044cae75488175a96cc18362a64518 (patch) | |
tree | d32f4ff87fc8d2dbffdf6b3e40830543c2f0f7b2 /drivers/usb/gadget/composite.c | |
parent | f4ce9084476dc518bfd0f35f62f4bd0a130893e0 (diff) | |
download | op-kernel-dev-daba58035a044cae75488175a96cc18362a64518.zip op-kernel-dev-daba58035a044cae75488175a96cc18362a64518.tar.gz |
USB: gadget: Remove suspended sysfs file before freeing cdev
cdev struct is accessed in suspended sysfs show function. So
remove sysfs file before freeing the cdev in composite_unbind.
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r-- | drivers/usb/gadget/composite.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 7b5cc16..96413a2 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1047,9 +1047,9 @@ composite_unbind(struct usb_gadget *gadget) kfree(cdev->req->buf); usb_ep_free_request(gadget->ep0, cdev->req); } + device_remove_file(&gadget->dev, &dev_attr_suspended); kfree(cdev); set_gadget_data(gadget, NULL); - device_remove_file(&gadget->dev, &dev_attr_suspended); composite = NULL; } |