V4L/DVB (4176): Bug-fix: Fix memory overflow
authorSigmund Augdal Helberg <sigmund@snap.tv>
Wed, 21 Jun 2006 13:35:48 +0000 (10:35 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 25 Jun 2006 05:05:19 +0000 (02:05 -0300)
Do not overflow kernel memory when more than BT878_MAX devices are
present.

Signed-off-by: Sigmund Augdal Helberg <sigmund@snap.tv>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/bt8xx/bt878.c

index 5500f8a0ffe2c6fa1f0013bbc8dc8ccb810f93dd..47281c9051497936c0ef409fce62440d4ab418ab 100644 (file)
@@ -417,6 +417,11 @@ static int __devinit bt878_probe(struct pci_dev *dev,
 
        printk(KERN_INFO "bt878: Bt878 AUDIO function found (%d).\n",
               bt878_num);
+       if (bt878_num >= BT878_MAX) {
+               printk(KERN_ERR "bt878: Too many devices inserted\n");
+               result = -ENOMEM;
+               goto fail0;
+       }
        if (pci_enable_device(dev))
                return -EIO;