]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: function: phonet: balance usb_ep_disable calls
authorFelipe Balbi <balbi@ti.com>
Mon, 2 Feb 2015 22:24:17 +0000 (16:24 -0600)
committerFelipe Balbi <balbi@ti.com>
Mon, 23 Feb 2015 06:18:52 +0000 (00:18 -0600)
commitf7084e496303dad262adbf1ea15d6d5bce7d7abc
tree808aa58e84cbe0f90379b2bcc73d2ea9e0296b8f
parent9f1eafd72e66d983f922549c72abc56399bcb6fa
usb: gadget: function: phonet: balance usb_ep_disable calls

f_phonet's ->set_alt() method will call usb_ep_disable()
potentially on an endpoint which is already disabled. That's
something the gadget/function driver must guarantee that it's
always balanced.

In order to balance the calls, just make sure the endpoint
was enabled before by means of checking the validity of
driver_data.

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_phonet.c