Date: Fri, 8 Dec 2006 21:24:18 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111299 for review Message-ID: <200612082124.kB8LOI9Q065465@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111299 Change 111299 by sam@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612082124.kB8LOI9Q065465>