From: Sigmund Augdal Helberg Date: Wed, 21 Jun 2006 13:35:48 +0000 (-0300) Subject: V4L/DVB (4176): Bug-fix: Fix memory overflow X-Git-Tag: v2.6.18-rc1~862^2~28 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77e0be12100a3d40abfa46ef54c323b6cfff41ed;p=linux-2.6 V4L/DVB (4176): Bug-fix: Fix memory overflow Do not overflow kernel memory when more than BT878_MAX devices are present. Signed-off-by: Sigmund Augdal Helberg Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c index 5500f8a0ff..47281c9051 100644 --- a/drivers/media/dvb/bt8xx/bt878.c +++ b/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;