[PATCH] SAA7134 number of devices check
- Date: Mon, 25 Feb 2008 12:09:36 +1300
- From: Alan McIvor <alan.mcivor@xxxxxxxxxxxx>
- Subject: [PATCH] SAA7134 number of devices check
Hi,
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. Without it, the device driver currently does strange things if 9
or more SAA7134 devices exist in a system.
Dr Alan M. McIvor
Reveal Limited
--- 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