[PATCH] SAA7134 number of devices check
- Date: Thu, 20 Mar 2008 11:15:26 +1300
- From: Alan McIvor <alan.mcivor@xxxxxxxxxxxx>
- Subject: [PATCH] SAA7134 number of devices check
The SAA7134 device driver has a array for storing device information
in. This array is of size SAA7134_MAXBOARDS. This patch adds a check
of the number of boards already existing before adding a new
one.
This patch fixes reported problems when trying to add a 9th device into a
system.
Signed-off-by: Alan McIvor <alan.mcivor@xxxxxxxxxxxx>
--- linux/drivers/media/video/saa7134/saa7134-core.c.orig 2008-02-25 11:51:39.000000000 +1300
+++ linux/drivers/media/video/saa7134/saa7134-core.c 2008-02-25 11:56:24.000000000 +1300
@@ -994,6 +994,9 @@ static int __devinit saa7134_initdev(str
struct saa7134_mpeg_ops *mops;
int err;
+ if (saa7134_devcount == SAA7134_MAXBOARDS)
+ return -ENOMEM;
+
dev = kzalloc(sizeof(*dev),GFP_KERNEL);
if (NULL == dev)
return -ENOMEM;
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list