public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gspca: add sanity check for mandatory operations
@ 2009-11-17  6:47 Németh Márton
  2009-11-17  9:51 ` Jean-Francois Moine
  0 siblings, 1 reply; 2+ messages in thread
From: Németh Márton @ 2009-11-17  6:47 UTC (permalink / raw)
  To: Jean-Francois Moine, V4L Mailing List

From: Márton Németh <nm127@fremail.hu>

Add check for the mandatory config, init, start and pkt_scan
gspca subdriver operations.

Signed-off-by: Márton Németh <nm127@fremail.hu>
---
diff -r 182b5f8fa160 linux/drivers/media/video/gspca/gspca.c
--- a/linux/drivers/media/video/gspca/gspca.c	Sun Nov 15 10:05:30 2009 +0100
+++ b/linux/drivers/media/video/gspca/gspca.c	Tue Nov 17 07:42:34 2009 +0100
@@ -2035,6 +2035,12 @@
 		return -ENODEV;
 	}

+	/* check for mandatory operations */
+	BUG_ON(!sd_desc->config);
+	BUG_ON(!sd_desc->init);
+	BUG_ON(!sd_desc->start);
+	BUG_ON(!sd_desc->pkt_scan);
+
 	/* create the device */
 	if (dev_size < sizeof *gspca_dev)
 		dev_size = sizeof *gspca_dev;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-17  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-17  6:47 [PATCH] gspca: add sanity check for mandatory operations Németh Márton
2009-11-17  9:51 ` Jean-Francois Moine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox