Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB: cx88: improve error handling

Return -EINVAL if we don't find the right query control id.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Dan Carpenter and committed by
Mauro Carvalho Chehab
a41b2ea7 8e47567f

+4 -1
+4 -1
drivers/media/video/cx88/cx88-video.c
··· 1538 1538 c->id >= V4L2_CID_LASTP1) 1539 1539 return -EINVAL; 1540 1540 if (c->id == V4L2_CID_AUDIO_MUTE) { 1541 - for (i = 0; i < CX8800_CTLS; i++) 1541 + for (i = 0; i < CX8800_CTLS; i++) { 1542 1542 if (cx8800_ctls[i].v.id == c->id) 1543 1543 break; 1544 + } 1545 + if (i == CX8800_CTLS) 1546 + return -EINVAL; 1544 1547 *c = cx8800_ctls[i].v; 1545 1548 } else 1546 1549 *c = no_ctl;