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

security: avoid calling a NULL function pointer in drivers/video/tvaudio.c

NULL function pointers are very bad security wise. This one got caught by
kerneloops.org quite a few times, so it's happening in the field....

Fix is simple, check the function pointer for NULL, like 6 other places
in the same function are already doing.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arjan van de Ven and committed by
Linus Torvalds
5ba2f67a 64f1b653

+1 -1
+1 -1
drivers/media/video/tvaudio.c
··· 1792 1792 break; 1793 1793 case VIDIOC_S_FREQUENCY: 1794 1794 chip->mode = 0; /* automatic */ 1795 - if (desc->checkmode) { 1795 + if (desc->checkmode && desc->setmode) { 1796 1796 desc->setmode(chip,V4L2_TUNER_MODE_MONO); 1797 1797 if (chip->prevmode != V4L2_TUNER_MODE_MONO) 1798 1798 chip->prevmode = -1; /* reset previous mode */