Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d7d1adc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB fixes from Greg Kroah-Hartman:
 "Here are a number of small USB fixes for 3.4-rc5.

  Nothing major, as before, some USB gadget fixes.  There's a crash fix
  for a number of ASUS laptops on resume that had been reported by a
  number of different people.  We think the fix might also pertain to
  other machines, as this was a BIOS bug, and they seem to travel to
  different models and manufacturers quite easily.  Other than that,
  some other reported problems fixed as well."

* tag 'usb-3.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: gadget: udc-core: fix incompatibility with dummy-hcd
  usb: gadget: udc-core: fix wrong call order
  USB: cdc-wdm: fix race leading leading to memory corruption
  USB: EHCI: fix crash during suspend on ASUS computers
  usb gadget: uvc: uvc_request_data::length field must be signed
  usb: gadget: dummy: do not call pullup() on udc_stop()
  usb: musb: davinci.c: add missing unregister
  usb: musb: drop __deprecated flag
  USB: gadget: storage gadgets send wrong error code for unknown commands
  usb: otg: gpio_vbus: Add otg transceiver events and notifiers
parents f7b00693 41c8a48a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -157,8 +157,9 @@ static void wdm_out_callback(struct urb *urb)
	spin_lock(&desc->iuspin);
	desc->werr = urb->status;
	spin_unlock(&desc->iuspin);
	clear_bit(WDM_IN_USE, &desc->flags);
	kfree(desc->outbuf);
	desc->outbuf = NULL;
	clear_bit(WDM_IN_USE, &desc->flags);
	wake_up(&desc->wait);
}

@@ -338,7 +339,7 @@ static ssize_t wdm_write
	if (we < 0)
		return -EIO;

	desc->outbuf = buf = kmalloc(count, GFP_KERNEL);
	buf = kmalloc(count, GFP_KERNEL);
	if (!buf) {
		rv = -ENOMEM;
		goto outnl;
@@ -406,10 +407,12 @@ static ssize_t wdm_write
	req->wIndex = desc->inum;
	req->wLength = cpu_to_le16(count);
	set_bit(WDM_IN_USE, &desc->flags);
	desc->outbuf = buf;

	rv = usb_submit_urb(desc->command, GFP_KERNEL);
	if (rv < 0) {
		kfree(buf);
		desc->outbuf = NULL;
		clear_bit(WDM_IN_USE, &desc->flags);
		dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv);
	} else {
+9 −0
Original line number Diff line number Diff line
@@ -493,6 +493,15 @@ static int hcd_pci_suspend_noirq(struct device *dev)

	pci_save_state(pci_dev);

	/*
	 * Some systems crash if an EHCI controller is in D3 during
	 * a sleep transition.  We have to leave such controllers in D0.
	 */
	if (hcd->broken_pci_sleep) {
		dev_dbg(dev, "Staying in PCI D0\n");
		return retval;
	}

	/* If the root hub is dead rather than suspended, disallow remote
	 * wakeup.  usb_hc_died() should ensure that both hosts are marked as
	 * dying, so we only need to check the primary roothub.
+0 −1
Original line number Diff line number Diff line
@@ -927,7 +927,6 @@ static int dummy_udc_stop(struct usb_gadget *g,

	dum->driver = NULL;

	dummy_pullup(&dum->gadget, 0);
	return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -2189,7 +2189,7 @@ unknown_cmnd:
		common->data_size_from_cmnd = 0;
		sprintf(unknown, "Unknown x%02x", common->cmnd[0]);
		reply = check_command(common, common->cmnd_size,
				      DATA_DIR_UNKNOWN, 0xff, 0, unknown);
				      DATA_DIR_UNKNOWN, ~0, 0, unknown);
		if (reply == 0) {
			common->curlun->sense_data = SS_INVALID_COMMAND;
			reply = -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -2579,7 +2579,7 @@ static int do_scsi_command(struct fsg_dev *fsg)
		fsg->data_size_from_cmnd = 0;
		sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]);
		if ((reply = check_command(fsg, fsg->cmnd_size,
				DATA_DIR_UNKNOWN, 0xff, 0, unknown)) == 0) {
				DATA_DIR_UNKNOWN, ~0, 0, unknown)) == 0) {
			fsg->curlun->sense_data = SS_INVALID_COMMAND;
			reply = -EINVAL;
		}
Loading