usb/107701: usbd ignores "detach"

Julian H. Stacey jhs at flat.berklix.net
Wed Jan 10 12:12:32 UTC 2007


People may have missed this ( hidden under a repost, sorry).

I can reproduce on 6.1-RELEASE error seen by Atom Smasher <atom at smasher.org>

> Loads of people Should have stumbled on this.
> I've found the bug in the code.
> This diff just marks the bug.
> 
> *** /host/fire/usr/src/usr.sbin/usbd/usbd.c	Fri Jul  1 17:49:52 2005
> --- usbd.c	Wed Jan 10 01:54:54 2007
> ***************
> *** 879,886 ****
> --- 879,891 ----
>   
>   		devinfo = &events.u.ue_device;
>   		for (i = 0; i < USB_MAX_DEVNAMES; i++) {
> + printf("  \nJHS1\n" );
>   			if (devinfo->udi_devnames[i][0] == '\0')
>   				break;
> + 				/* This break is a problem it prevents
> + 				   USB_EVENT_IS_DETACH being run at JHS3
> + 				*/
> + printf("  \nJHS2\n" );
>   
>   			memcpy(&the_event, &events, sizeof(the_event));
>   			the_devinfo = &the_event.u.ue_device;
> ***************
> *** 925,930 ****
> --- 930,936 ----
>   				if (USB_EVENT_IS_ATTACH(the_event.ue_type) &&
>   					action_match.action->attach) 
>   					execute_command(action_match.action->attach);
> + printf("  \nJHS3\n" );
>   				if (USB_EVENT_IS_DETACH(the_event.ue_type) &&
>   					action_match.action->detach)
>   					execute_command(action_match.action->detach);
> 
> 
> The error is still there in 6-Stable too.
> There is no src/usr.sbin/usbd/usbd.c in current.
> I don't know the code, & too tired & busy to fix this,
> Someone else here able to fix it & post a patch ?
> If not, Atom Smasher <atom at smasher.org> please use
> send-pr to report this identified bug.

-- 
Julian Stacey.  BSD Unix C Net Consultancy, Munich/Muenchen  http://berklix.com
Mail Ascii, not HTML.		Ihr Rauch = mein allergischer Kopfschmerz.
			http://berklix.org/free-software


More information about the freebsd-usb mailing list