summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-09-07 18:47:03 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-07 18:47:03 +0200
commitc25887f52f7f1eaefeed7dfbd968f93b17e1f97d (patch)
tree00202c527767c78d4564d8ab55510dac1b43fcb9 /linux/drivers/media/video/bt8xx/bttv-driver.c
parentb510f97758d8efa413e8ca7ab0457b1951c372c9 (diff)
downloadmediapointer-dvb-s2-c25887f52f7f1eaefeed7dfbd968f93b17e1f97d.tar.gz
mediapointer-dvb-s2-c25887f52f7f1eaefeed7dfbd968f93b17e1f97d.tar.bz2
bttv: Prevent NULL pointer dereference in radio_open
From: Jean Delvare <khali@linux-fr.org> Fix the following crash in the bttv driver: BUG: unable to handle kernel NULL pointer dereference at 000000000000036c IP: [<ffffffffa037860a>] radio_open+0x3a/0x170 [bttv] This happens because radio_open assumes that all present bttv devices have a radio function. If a bttv device without radio and one with radio are installed on the same system, and the one without radio is registered first, then radio_open checks for the radio device number of a bttv device that has no radio function, and this breaks. All we have to do to fix it is to skip bttv devices without a radio function. Priority: high Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c
index 1c8183c2c..8d398a4b0 100644
--- a/linux/drivers/media/video/bt8xx/bttv-driver.c
+++ b/linux/drivers/media/video/bt8xx/bttv-driver.c
@@ -3463,7 +3463,7 @@ static int radio_open(struct inode *inode, struct file *file)
lock_kernel();
for (i = 0; i < bttv_num; i++) {
- if (bttvs[i].radio_dev->minor == minor) {
+ if (bttvs[i].radio_dev && bttvs[i].radio_dev->minor == minor) {
btv = &bttvs[i];
break;
}