possible race in usb_autopm_get_interface_async()

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

 



Hi Alan,

I am looking at using the interface in practice. It seems to me that
pm_usage_cnt can become corrupted if usb_autopm_get_interface_async()
and usb_autopm_put_interface_async() race. Convert it to atomic_t?

	Regards
		Oliver

int usb_autopm_get_interface_async(struct usb_interface *intf)
{
	struct usb_device	*udev = interface_to_usbdev(intf);
	int			status = 0;

	if (intf->condition == USB_INTERFACE_UNBOUND)
		status = -ENODEV;
	else if (udev->autoresume_disabled)
		status = -EPERM;
	else if (++intf->pm_usage_cnt > 0 && udev->state == USB_STATE_SUSPENDED)

			^ locking needed

--
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