Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2b4fbec authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa Committed by Gerrit - the friendly Code Review server
Browse files

USB: uvc_video: Check for return value before halt bulk endpoint



Currently driver is trying to halt bulk endpoint when ep_queue
fails by checking endpoint type. If ep_queue and endpoint  disable
race each other, there is chance that NULL pointer dereference as
ep->desc which will be set to NULL in ep_disable callback. Fix it
by checking return value of ep_queue and try to halt only if return
value is not -ESHUTDOWN.

Change-Id: I2c8f20316c1b7fb9a1c6fc8f4409dd14c2f780c6
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 30e09956
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -133,7 +133,8 @@ static int uvcg_video_ep_queue(struct uvc_video *video, struct usb_request *req)
	if (ret < 0) {
		printk(KERN_INFO "Failed to queue request (%d).\n", ret);
		/* Isochronous endpoints can't be halted. */
		if (usb_endpoint_xfer_bulk(video->ep->desc))
		if ((ret != -ESHUTDOWN) &&
				usb_endpoint_xfer_bulk(video->ep->desc))
			usb_ep_set_halt(video->ep);
	}