From 7aa19975d2e6a91609299655e42a1f565b19fb84 Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Wed, 21 Jun 2006 17:35:48 +0400 Subject: Bug-fix: Do not overflow kernel memory when more than BT878_MAX devices are present From: Sigmund Augdal Helberg Signed-off-by: Sigmund Augdal Helberg Signed-off-by: Manu Abraham --- linux/drivers/media/dvb/bt8xx/bt878.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux/drivers') diff --git a/linux/drivers/media/dvb/bt8xx/bt878.c b/linux/drivers/media/dvb/bt8xx/bt878.c index 5500f8a0f..47281c905 100644 --- a/linux/drivers/media/dvb/bt8xx/bt878.c +++ b/linux/drivers/media/dvb/bt8xx/bt878.c @@ -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; -- cgit v1.2.3