> if (!port || port->serial->dev->state == > USB_STATE_NOTATTACHED)
> There's no use checking for attachement. The state > may have changed. > In fact, if a device is disconnected via sysfs, this > code will happily write > to a device somebody else has claimed. I don't understand. serial->dev is usb_device* and it is protected by ref counting (using usb_get_dev). So, it should not disappear or be claimed by anybody else, right? As for the USB_STATE_NOTATTACHED, there is a long comment in hub.c about it. Also I see plenty of code, which checks it without any lock. So, I guess, it should not kill anybody. John __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel