changeset 4100:bf306dd84529

6516938 panic happen when force the usbvc driver to attach to a webcam not compliant to usb video class spec
author fb209375
date Tue, 24 Apr 2007 19:26:48 -0700
parents 9c9793408924
children d2bbdc69fd44
files usr/src/uts/common/io/usb/clients/video/usbvc/usbvc.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/usb/clients/video/usbvc/usbvc.c	Tue Apr 24 17:25:22 2007 -0700
+++ b/usr/src/uts/common/io/usb/clients/video/usbvc/usbvc.c	Tue Apr 24 19:26:48 2007 -0700
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -2154,6 +2154,17 @@
 		}
 	}
 
+	/*
+	 * For webcam which is not compliant to video class specification
+	 * and no header descriptor in VC interface, return USB_FAILURE.
+	 */
+	if (!usbvcp->usbvc_vc_header) {
+		USB_DPRINTF_L2(PRINT_MASK_ATTA, usbvcp->usbvc_log_handle,
+		    "usbvc_parse_ctrl_if: no header descriptor");
+
+		return (USB_FAILURE);
+	}
+
 	return (USB_SUCCESS);
 }