public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Sebastian Andrzej Siewior <sebastian@breakpoint.cc>,
	Felipe Balbi <balbi@ti.com>
Subject: [ 064/108] usb: gadget: dummy_hcd: fixup error probe path
Date: Sun, 07 Oct 2012 23:59:38 +0100	[thread overview]
Message-ID: <20121007225843.550386485@decadent.org.uk> (raw)
In-Reply-To: <20121007225834.673681075@decadent.org.uk>

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>

commit 1b68a4ca2d038addb7314211d122fb6d7002b38b upstream.

If USB2 host controller probes fine but USB3 does not then we don't
remove the USB controller properly and lock up the system while the HUB
code will try to enumerate the USB2 controller and access memory which
is no longer available in case the dummy_hcd was compiled as a module.

This is a problem since 448b6eb1 ("USB: Make sure to fetch the BOS desc
for roothubs.) if used in USB3 mode because dummy does not provide this
descriptor and explodes later.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/gadget/dummy_hcd.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index b799106..0e58a46 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -2503,10 +2503,8 @@ static int dummy_hcd_probe(struct platform_device *pdev)
 	hs_hcd->has_tt = 1;
 
 	retval = usb_add_hcd(hs_hcd, 0, 0);
-	if (retval != 0) {
-		usb_put_hcd(hs_hcd);
-		return retval;
-	}
+	if (retval)
+		goto put_usb2_hcd;
 
 	if (mod_data.is_super_speed) {
 		ss_hcd = usb_create_shared_hcd(&dummy_hcd, &pdev->dev,
@@ -2525,6 +2523,8 @@ static int dummy_hcd_probe(struct platform_device *pdev)
 put_usb3_hcd:
 	usb_put_hcd(ss_hcd);
 dealloc_usb2_hcd:
+	usb_remove_hcd(hs_hcd);
+put_usb2_hcd:
 	usb_put_hcd(hs_hcd);
 	the_controller.hs_hcd = the_controller.ss_hcd = NULL;
 	return retval;



  parent reply	other threads:[~2012-10-07 23:23 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-07 22:58 [ 000/108] 3.2.31-stable review Ben Hutchings
2012-10-07 22:58 ` [ 001/108] target: Fix ->data_length re-assignment bug with SCSI overflow Ben Hutchings
2012-10-07 22:58 ` [ 002/108] ASoC: samsung dma - Dont indicate support for pause/resume Ben Hutchings
2012-10-07 22:58 ` [ 003/108] fs/proc: fix potential unregister_sysctl_table hang Ben Hutchings
2012-10-07 22:58 ` [ 004/108] mm/ia64: fix a memory block size bug Ben Hutchings
2012-10-07 22:58 ` [ 005/108] nbd: clear waiting_queue on shutdown Ben Hutchings
2012-10-07 22:58 ` [ 006/108] drivers/rtc/rtc-twl.c: ensure all interrupts are disabled during probe Ben Hutchings
2012-10-07 22:58 ` [ 007/108] mm/page_alloc: fix the page address of higher pages buddy calculation Ben Hutchings
2012-10-07 22:58 ` [ 008/108] memory hotplug: fix section info double registration bug Ben Hutchings
2012-10-07 22:58 ` [ 009/108] cciss: fix handling of protocol error Ben Hutchings
2012-10-07 22:58 ` [ 010/108] vfs: dcache: use DCACHE_DENTRY_KILLED instead of DCACHE_DISCONNECTED in d_kill() Ben Hutchings
2012-10-07 22:58 ` [ 011/108] workqueue: reimplement work_on_cpu() using system_wq Ben Hutchings
2012-10-07 22:58 ` [ 012/108] cpufreq/powernow-k8: workqueue user shouldnt migrate the kworker to another CPU Ben Hutchings
2012-10-07 22:58 ` [ 013/108] sched: Fix ancient race in do_exit() Ben Hutchings
2012-10-07 22:58 ` [ 014/108] hpwdt: Fix kdump issue in hpwdt Ben Hutchings
2012-10-07 22:58 ` [ 015/108] rtlwifi: rtl8192ce: Log message that B_CUT device may not work Ben Hutchings
2012-10-07 22:58 ` [ 016/108] brcmfmac: fix big endian bug in i-scan Ben Hutchings
2012-10-07 22:58 ` [ 017/108] brcmfmac: Fix big endian host configuration data Ben Hutchings
2012-10-07 22:58 ` [ 018/108] dmaengine: at_hdmac: fix comment in atc_prep_slave_sg() Ben Hutchings
2012-10-07 22:58 ` [ 019/108] dmaengine: at_hdmac: check that each sg data length is non-null Ben Hutchings
2012-10-07 22:58 ` [ 020/108] ARM: 7532/1: decompressor: reset SCTLR.TRE for VMSA ARMv7 cores Ben Hutchings
2012-10-07 22:58 ` [ 021/108] drm/i915: Reduce a pin-leak BUG into a WARN Ben Hutchings
2012-10-07 22:58 ` [ 022/108] drm/i915: HDMI - Clear Audio Enable bit for Hot Plug Ben Hutchings
2012-10-07 22:58 ` [ 023/108] [SCSI] bnx2i: Fixed NULL ptr deference for 1G bnx2 Linux iSCSI offload Ben Hutchings
2012-10-07 22:58 ` [ 024/108] [SCSI] mpt2sas: Fix for issue - Unable to boot from the drive connected to HBA Ben Hutchings
2012-10-07 22:58 ` [ 025/108] hwmon: (ads7871) Add name sysfs attribute Ben Hutchings
2012-10-07 22:59 ` [ 026/108] DMA: PL330: Check the pointer returned by kzalloc Ben Hutchings
2012-10-07 22:59 ` [ 027/108] [SCSI] hpsa: fix handling of protocol error Ben Hutchings
2012-10-07 22:59 ` [ 028/108] ARM: imx: armadillo5x0: Fix illegal register access Ben Hutchings
2012-10-07 23:37   ` Estevam Fabio-R49496
2012-10-10  2:24     ` Ben Hutchings
2012-10-07 22:59 ` [ 029/108] hwmon: (ad7314) Add name sysfs attribute Ben Hutchings
2012-10-07 22:59 ` [ 030/108] cifs: fix return value in cifsConvertToUTF16 Ben Hutchings
2012-10-07 22:59 ` [ 031/108] cfg80211: fix possible circular lock on reg_regdb_search() Ben Hutchings
2012-10-07 22:59 ` [ 032/108] xen/boot: Disable BIOS SMP MP table search Ben Hutchings
2012-10-07 22:59 ` [ 033/108] asix: Support DLink DUB-E100 H/W Ver C1 Ben Hutchings
2012-10-07 22:59 ` [ 034/108] Input: i8042 - disable mux on Toshiba C850D Ben Hutchings
2012-10-07 22:59 ` [ 035/108] tracing: Dont call page_to_pfn() if page is NULL Ben Hutchings
2012-10-07 22:59 ` [ 036/108] can: janz-ican3: fix support for older hardware revisions Ben Hutchings
2012-10-07 22:59 ` [ 037/108] can: ti_hecc: fix oops during rmmod Ben Hutchings
2012-10-07 22:59 ` [ 038/108] HID: logitech: fix mask to enable DJ mode Ben Hutchings
2012-10-07 22:59 ` [ 039/108] HID: logitech: dont use stack based dj_report structures Ben Hutchings
2012-10-07 22:59 ` [ 040/108] dj: memory scribble in logi_dj Ben Hutchings
2012-10-07 22:59 ` [ 041/108] HID: Fix logitech-dj: missing Unifying device issue Ben Hutchings
2012-10-07 22:59 ` [ 042/108] hwmon: (fam15h_power) Tweak runavg_range on resume Ben Hutchings
2012-10-07 22:59 ` [ 043/108] xen/boot: Disable NUMA for PV guests Ben Hutchings
2012-10-07 22:59 ` [ 044/108] gpio-lpc32xx: Fix value handling of gpio_direction_output() Ben Hutchings
2012-10-07 22:59 ` [ 045/108] sb_edac: Avoid overflow errors at memory size calculation Ben Hutchings
2012-10-07 22:59 ` [ 046/108] dm: handle requests beyond end of device instead of using BUG_ON Ben Hutchings
2012-10-07 22:59 ` [ 047/108] dm table: clear add_random unless all devices have it set Ben Hutchings
2012-10-07 22:59 ` [ 048/108] md/raid10: fix "enough" function for detecting if array is failed Ben Hutchings
2012-10-07 22:59 ` [ 049/108] USB: Fix race condition when removing host controllers Ben Hutchings
2012-10-07 22:59 ` [ 050/108] asus-laptop: HRWS/HWRS typo Ben Hutchings
2012-10-07 22:59 ` [ 051/108] Bluetooth: btusb: Add vendor specific ID (0a5c:21f4) BCM20702A0 Ben Hutchings
2012-10-07 22:59 ` [ 052/108] Bluetooth: Use USB_VENDOR_AND_INTERFACE() for Broadcom devices Ben Hutchings
2012-10-07 22:59 ` [ 053/108] Bluetooth: Add support for Apple vendor-specific devices Ben Hutchings
2012-10-07 22:59 ` [ 054/108] net: Statically initialize init_net.dev_base_head Ben Hutchings
2012-10-07 22:59 ` [ 055/108] Fix a dead loop in async_synchronize_full() Ben Hutchings
2012-10-07 22:59 ` [ 056/108] rds: set correct msg_namelen Ben Hutchings
2012-10-07 22:59 ` [ 057/108] [libata] Prevent interface errors with Seagate FreeAgent GoFlex Ben Hutchings
2012-10-07 22:59 ` [ 058/108] mmc: Prevent 1.8V switch for SD hosts that dont support UHS modes Ben Hutchings
2012-10-07 22:59 ` [ 059/108] Bluetooth: Change signature of smp_conn_security() Ben Hutchings
2012-10-07 22:59 ` [ 060/108] Bluetooth: Fix sending a HCI Authorization Request over LE links Ben Hutchings
2012-10-07 22:59 ` [ 061/108] pch_uart: Add eg20t_port lock field, avoid recursive spinlocks Ben Hutchings
2012-10-07 22:59 ` [ 062/108] irq_remap: disable IRQ remapping if any IOAPIC lacks an IOMMU Ben Hutchings
2012-10-07 22:59 ` [ 063/108] vfs: dcache: fix deadlock in tree traversal Ben Hutchings
2012-10-07 22:59 ` Ben Hutchings [this message]
2012-10-07 22:59 ` [ 065/108] CPU hotplug, cpusets, suspend: Dont modify cpusets during suspend/resume Ben Hutchings
2012-10-07 22:59 ` [ 066/108] Revert "drm/radeon: rework pll selection (v3)" Ben Hutchings
2012-10-07 22:59 ` [ 067/108] x86/alternatives: Fix p6 nops on non-modular kernels Ben Hutchings
2012-10-07 22:59 ` [ 068/108] HID: hidraw: add proper error handling to raw event reporting Ben Hutchings
2012-10-08 19:34   ` Herton Ronaldo Krzesinski
2012-10-10  2:25     ` Ben Hutchings
2012-10-07 22:59 ` [ 069/108] HID: hidraw: fix list->buffer memleak Ben Hutchings
2012-10-07 22:59 ` [ 070/108] HID: hidraw: improve error handling in hidraw_init() Ben Hutchings
2012-10-07 22:59 ` [ 071/108] HID: hidraw: dont deallocate memory when it is in use Ben Hutchings
2012-10-07 22:59 ` [ 072/108] PCI: acpiphp: check whether _ADR evaluation succeeded Ben Hutchings
2012-10-07 22:59 ` [ 073/108] bnx2x: fix rx checksum validation for IPv6 Ben Hutchings
2012-10-07 22:59 ` [ 074/108] xfrm: Workaround incompatibility of ESN and async crypto Ben Hutchings
2012-10-07 22:59 ` [ 075/108] xfrm_user: return error pointer instead of NULL Ben Hutchings
2012-10-07 22:59 ` [ 076/108] xfrm_user: return error pointer instead of NULL #2 Ben Hutchings
2012-10-07 22:59 ` [ 077/108] xfrm: fix a read lock imbalance in make_blackhole Ben Hutchings
2012-10-07 22:59 ` [ 078/108] xfrm_user: fix info leak in copy_to_user_auth() Ben Hutchings
2012-10-07 22:59 ` [ 079/108] xfrm_user: fix info leak in copy_to_user_state() Ben Hutchings
2012-10-07 22:59 ` [ 080/108] xfrm_user: fix info leak in copy_to_user_policy() Ben Hutchings
2012-10-07 22:59 ` [ 081/108] xfrm_user: fix info leak in copy_to_user_tmpl() Ben Hutchings
2012-10-07 22:59 ` [ 082/108] xfrm_user: dont copy esn replay window twice for new states Ben Hutchings
2012-10-07 22:59 ` [ 083/108] xfrm_user: ensure user supplied esn replay window is valid Ben Hutchings
2012-10-07 22:59 ` [ 084/108] net: ethernet: davinci_cpdma: decrease the desc count when cleaning up the remaining packets Ben Hutchings
2012-10-07 22:59 ` [ 085/108] ixp4xx_hss: fix build failure due to missing linux/module.h inclusion Ben Hutchings
2012-10-07 23:00 ` [ 086/108] netxen: check for root bus in netxen_mask_aer_correctable Ben Hutchings
2012-10-07 23:00 ` [ 087/108] net-sched: sch_cbq: avoid infinite loop Ben Hutchings
2012-10-07 23:00 ` [ 088/108] pkt_sched: fix virtual-start-time update in QFQ Ben Hutchings
2012-10-07 23:00 ` [ 089/108] sierra_net: Endianess bug fix Ben Hutchings
2012-10-07 23:00 ` [ 090/108] 8021q: fix mac_len recomputation in vlan_untag() Ben Hutchings
2012-10-07 23:00 ` [ 091/108] ipv6: release reference of ip6_null_entrys dst entry in __ip6_del_rt Ben Hutchings
2012-10-07 23:00 ` [ 092/108] tcp: flush DMA queue before sk_wait_data if rcv_wnd is zero Ben Hutchings
2012-10-07 23:00 ` [ 093/108] sctp: Dont charge for data in sndbuf again when transmitting packet Ben Hutchings
2012-10-07 23:00 ` [ 094/108] pppoe: drop PPPOX_ZOMBIEs in pppoe_release Ben Hutchings
2012-10-07 23:00 ` [ 095/108] net: small bug on rxhash calculation Ben Hutchings
2012-10-07 23:00 ` [ 096/108] net: guard tcp_set_keepalive() to tcp sockets Ben Hutchings
2012-10-07 23:00 ` [ 097/108] ipv4: raw: fix icmp_filter() Ben Hutchings
2012-10-07 23:00 ` [ 098/108] ipv6: raw: fix icmpv6_filter() Ben Hutchings
2012-10-07 23:00 ` [ 099/108] ipv6: mip6: fix mip6_mh_filter() Ben Hutchings
2012-10-07 23:00 ` [ 100/108] l2tp: fix a typo in l2tp_eth_dev_recv() Ben Hutchings
2012-10-07 23:00 ` [ 101/108] netrom: copy_datagram_iovec can fail Ben Hutchings
2012-10-07 23:00 ` [ 102/108] net: do not disable sg for packets requiring no checksum Ben Hutchings
2012-10-07 23:00 ` [ 103/108] aoe: assert AoE packets marked as " Ben Hutchings
2012-10-07 23:00 ` [ 104/108] tg3: Fix TSO CAP for 5704 devs w / ASF enabled Ben Hutchings
2012-10-07 23:00 ` [ 105/108] Bluetooth: Support AR3011 in Acer Iconia Tab W500 Ben Hutchings
2012-10-07 23:00 ` [ 106/108] Bluetooth: add support for atheros 0930:0219 Ben Hutchings
2012-10-07 23:00 ` [ 107/108] Bluetooth: add support for atheros 0489:e057 Ben Hutchings
2012-10-07 23:00 ` [ 108/108] Bluetooth: Add support for Sony Vaio T-Series Ben Hutchings
2012-10-08 13:05 ` [ 000/108] 3.2.31-stable review Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121007225843.550386485@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=balbi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastian@breakpoint.cc \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox