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

Commit b02064ca authored by Dean Anderson's avatar Dean Anderson Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (11738): patch: s2255drv: urb completion routine fixes



Error count in read pipe completion corrected.
URB not resubmitted if shutting down.
URB not freed in completion routine if new urb_submit_fails.
(URB is freed on shutdown).

Signed-off-by: default avatarDean Anderson <dean@sensoray.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1fcbcc47
Loading
Loading
Loading
Loading
+10 −5
Original line number Original line Diff line number Diff line
@@ -2281,8 +2281,10 @@ static void read_pipe_completion(struct urb *purb)
		return;
		return;
	}
	}
	status = purb->status;
	status = purb->status;
	if (status != 0) {
	/* if shutting down, do not resubmit, exit immediately */
		dprintk(2, "read_pipe_completion: err\n");
	if (status == -ESHUTDOWN) {
		dprintk(2, "read_pipe_completion: err shutdown\n");
		pipe_info->err_count++;
		return;
		return;
	}
	}


@@ -2291,9 +2293,13 @@ static void read_pipe_completion(struct urb *purb)
		return;
		return;
	}
	}


	if (status == 0)
		s2255_read_video_callback(dev, pipe_info);
		s2255_read_video_callback(dev, pipe_info);
	else {
		pipe_info->err_count++;
		dprintk(1, "s2255drv: failed URB %d\n", status);
	}


	pipe_info->err_count = 0;
	pipe = usb_rcvbulkpipe(dev->udev, dev->read_endpoint);
	pipe = usb_rcvbulkpipe(dev->udev, dev->read_endpoint);
	/* reuse urb */
	/* reuse urb */
	usb_fill_bulk_urb(pipe_info->stream_urb, dev->udev,
	usb_fill_bulk_urb(pipe_info->stream_urb, dev->udev,
@@ -2305,7 +2311,6 @@ static void read_pipe_completion(struct urb *purb)
	if (pipe_info->state != 0) {
	if (pipe_info->state != 0) {
		if (usb_submit_urb(pipe_info->stream_urb, GFP_KERNEL)) {
		if (usb_submit_urb(pipe_info->stream_urb, GFP_KERNEL)) {
			dev_err(&dev->udev->dev, "error submitting urb\n");
			dev_err(&dev->udev->dev, "error submitting urb\n");
			usb_free_urb(pipe_info->stream_urb);
		}
		}
	} else {
	} else {
		dprintk(2, "read pipe complete state 0\n");
		dprintk(2, "read pipe complete state 0\n");