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

Commit aab9796f authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB: s2255drv: return if vdev not found



The original code didn't handle the case where vdev was not found so I
added a check for that.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Cc: linux-dev@sensoray.com
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b9245d80
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1716,11 +1716,15 @@ static int s2255_open(struct file *file)
	dprintk(1, "s2255: open called (dev=%s)\n",
		video_device_node_name(vdev));

	for (i = 0; i < MAX_CHANNELS; i++)
	for (i = 0; i < MAX_CHANNELS; i++) {
		if (&dev->vdev[i] == vdev) {
			cur_channel = i;
			break;
		}
	}
	if (i == MAX_CHANNELS)
		return -ENODEV;

	/*
	 * open lock necessary to prevent multiple instances
	 * of v4l-conf (or other programs) from simultaneously