usb: gadget: f_mass_storage: reset endpoint driver data when disabled
authorPeter Oh <poh@broadcom.com>
Mon, 16 Sep 2013 21:21:14 +0000 (14:21 -0700)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:46:18 +0000 (11:46 +0900)
commit64e6ecca151acdc1e840422b8f64e59e21b17869
tree7f6683fcd634481bc730a0b4ce6b00a7b539f211
parent604f89795fe16b00ed8a3e5e5257067ae2651f8f
usb: gadget: f_mass_storage: reset endpoint driver data when disabled

Gadgets endpoint driver data is a criteria to judge that
whether the endpoints are in use or not. When gadget gets
assigned an endpoint from endpoint list, they check its
driver data if the driver data is NULL.

If the driver data is not NULL then they regard it as in use.
Therefore all of gadgets should reset their endpoints driver
data to NULL as they are disabled. Otherwise it causes a leak
of endpoint resource.

Signed-off-by: Peter Oh <poh@broadcom.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_mass_storage.c