cvs commit: src/sys/dev/usb ugen.c

Stefan Farfeleder stefanf at FreeBSD.org
Sat Dec 25 06:17:59 PST 2004


On Sun, Dec 12, 2004 at 02:27:30AM +0000, Julian Elischer wrote:
> julian      2004-12-12 02:27:30 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/usb          ugen.c 
>   Log:
>   Changes to cache endpoint descriptors for all the interfaces. this information
>   is not always available if we change interfaces.

This causes a null pointer dereference in idestroy_dev() if I try to
get pictures from my camera with gphoto.  I think it is due to both
ugen_do_ioctl() and ugen_set_config() calling ugen_destroy_devnodes().
Here's a fix which works for me.

Stefan
-------------- next part --------------
Index: src/sys/dev/usb/ugen.c
===================================================================
RCS file: /b/ncvs/src/sys/dev/usb/ugen.c,v
retrieving revision 1.101
diff -I.svn -u -r1.101 ugen.c
--- src/sys/dev/usb/ugen.c	22 Dec 2004 17:31:44 -0000	1.101
+++ src/sys/dev/usb/ugen.c	25 Dec 2004 13:59:13 -0000
@@ -1329,9 +1329,6 @@
 	case USB_SET_CONFIG:
 		if (!(flag & FWRITE))
 			return (EPERM);
-#if defined(__FreeBSD__)
-		ugen_destroy_devnodes(sc);
-#endif
 		err = ugen_set_config(sc, *(int *)addr);
 		switch (err) {
 		case USBD_NORMAL_COMPLETION:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20041225/cfaa8b7a/attachment.bin


More information about the cvs-src mailing list