usb: gadget: udc-core: fix kernel crash on soft_connect and srp interfaces
authorPreetham Chandru <pchandru@nvidia.com>
Wed, 2 May 2012 13:32:58 +0000 (18:32 +0530)
committerSimone Willett <swillett@nvidia.com>
Wed, 9 May 2012 18:31:58 +0000 (11:31 -0700)
commit446b1ef096686dade535c7316e536d3d743c0331
tree7b724a5088829387f6a8e1af41ffdb067f1ebac1
parent8fbd140659857935fab495332e71b99486792b21
usb: gadget: udc-core: fix kernel crash on soft_connect and srp interfaces

We should not call dev_get_drvdata() as the driver data is never set.
We should use container_of() as it is been used for other sysfs attributes.
Without this change writing to the soft_connect or srp interfaces crashes
the kernel because of null pointer dereference.

Bug 975473
Signed-off-by: Preeham Chandru R <pchandru@nvidia.com>

Change-Id: I45f6dab32f5435d518bd5b4fcdfafa54b9b89acd
Reviewed-on: http://git-master/r/100238
Tested-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Kiran Adduri <kadduri@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
drivers/usb/gadget/udc-core.c