Re: [patch]unbalanced calls to post_reset() from usb_reset_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oliver:

I just noticed a problem with your patch.  You removed the test for 
drv->post_reset being non-NULL before invoking it.  That's not safe, 
because it is possible that rebinding isn't needed even though the 
post_reset method is missing.

This can happen because of these lines earlier in usb_reset_device():

				if (drv->pre_reset && drv->post_reset)
					unbind = (drv->pre_reset)(cintf);
				else if (cintf->condition ==
						USB_INTERFACE_BOUND)
					unbind = 1;

If the interface is in the middle of binding or unbinding when the
reset occurs, the driver need not have a pre_reset or post_reset
method.  This exception is for the drivers that do a reset within their
probe routine, of which there are (or were) several.  So the test has
to be retained.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux