From: Alan McIvor Date: Tue, 22 Apr 2008 17:46:09 +0000 (-0300) Subject: V4L/DVB (7394): saa7134: add number of devices check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a4df8e1d6ae460546dfa3b4f23a85cb5a4255109;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git V4L/DVB (7394): saa7134: add number of devices check 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 599273894f34..eec127864fe3 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c @@ -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;