From 03ce4f2e40560c24703b1f60c0adda58500adf38 Mon Sep 17 00:00:00 2001 From: Hartmut Hackmann Date: Thu, 20 Mar 2008 01:35:15 +0100 Subject: saa7134: add number of devices check From: Alan McIvor This patch fixes reported problems when trying to add a 9th device into a system. Signed-off-by: Alan McIvor Signed-off-by: Hartmut Hackmann --- linux/drivers/media/video/saa7134/saa7134-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index 181936e2e..7296eeba0 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -962,6 +962,9 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, int err; int mask; + if (saa7134_devcount == SAA7134_MAXBOARDS) + return -ENOMEM; + dev = kzalloc(sizeof(*dev),GFP_KERNEL); if (NULL == dev) return -ENOMEM; -- cgit v1.2.3