V4L/DVB (7394): saa7134: add number of devices check
authorAlan McIvor <alan.mcivor@reveal.co.nz>
Tue, 22 Apr 2008 17:46:09 +0000 (14:46 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:07:52 +0000 (14:07 -0300)
This patch fixes reported problems when trying to add a 9th device into a
system.

Signed-off-by: Alan McIvor <alan.mcivor@reveal.co.nz>
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/saa7134/saa7134-core.c

index 5992738..eec1278 100644 (file)
@@ -866,6 +866,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;