]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - drivers/usb/dwc3/gadget.c
usb: dwc3: gadget: Fix desc NULL pointer in dwc3_gadget_ep_queue()
authorZhuang Jin Can <jin.can.zhuang@intel.com>
Wed, 3 Sep 2014 06:26:34 +0000 (14:26 +0800)
committerFelipe Balbi <balbi@ti.com>
Wed, 3 Sep 2014 20:15:55 +0000 (15:15 -0500)
commitfdee4ebac96bb44c9c488fdd830b7cc831cd295d
treed54527d09c12328d1836648a58a55990c10df36f
parent9ce9ec95fb9b82e09b55a52f1bb8a362bf8f74d8
usb: dwc3: gadget: Fix desc NULL pointer in dwc3_gadget_ep_queue()

dep->endpoint.desc is checked at the beginning of
dwc3_gadget_ep_queue(), but after that it may be set to NULL
by another thread and then accessed again in dwc3_gadget_ep_queue().
This will lead to kernel oops.

Expand spinlock protection area to aviod race condition.

Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c