PERFORCE change 111299 for review

Sam Leffler sam at FreeBSD.org
Fri Dec 8 13:24:20 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=111299

Change 111299 by sam at sam_ebb on 2006/12/08 21:23:36

	o check for device existence before attaching so we don't
	  get duplicates
	o use device_set_desc_copy instead of a static buffer;
	  from jhb

Affected files ...

.. //depot/projects/crypto/sys/crypto/via/padlock.c#4 edit

Differences ...

==== //depot/projects/crypto/sys/crypto/via/padlock.c#4 (text+ko) ====

@@ -73,14 +73,15 @@
 padlock_identify(device_t *dev, device_t parent)
 {
 	/* NB: order 10 is so we get attached after h/w devices */
-	if (BUS_ADD_CHILD(parent, 10, "padlock", -1) == 0)
+	if (device_find_child(parent, "padlock", -1) == NULL &&
+	    BUS_ADD_CHILD(parent, 10, "padlock", -1) == 0)
 		panic("padlock: could not attach");
 }
 
 static int
 padlock_probe(device_t dev)
 {
-	static char capp[256];
+	char capp[256];
 
 #if defined(__i386__) && !defined(PC98)
 	/* If there is no AES support, we has nothing to do here. */
@@ -104,7 +105,7 @@
 	if (via_feature_xcrypt & VIA_HAS_MM)
 		strlcat(capp, ",RSA", sizeof(capp));
 #endif
-	device_set_desc(dev, capp);
+	device_set_desc_copy(dev, capp);
 #else
 	return (EINVAL);
 #endif


More information about the p4-projects mailing list