netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Ping-Ke Shih <pkshih@realtek.com>,
	syzbot+1fcc5ef45175fc774231@syzkaller.appspotmail.com,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Kalle Valo <kvalo@codeaurora.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.1 139/219] rtlwifi: rtl8192cu: fix error handle when usb probe failed
Date: Mon, 15 Jul 2019 10:02:20 -0400	[thread overview]
Message-ID: <20190715140341.6443-139-sashal@kernel.org> (raw)
In-Reply-To: <20190715140341.6443-1-sashal@kernel.org>

From: Ping-Ke Shih <pkshih@realtek.com>

[ Upstream commit 6c0ed66f1a5b84e2a812c7c2d6571a5621bf3396 ]

rtl_usb_probe() must do error handle rtl_deinit_core() only if
rtl_init_core() is done, otherwise goto error_out2.

| usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
| rtl_usb: reg 0xf0, usbctrl_vendorreq TimeOut! status:0xffffffb9 value=0x0
| rtl8192cu: Chip version 0x10
| rtl_usb: reg 0xa, usbctrl_vendorreq TimeOut! status:0xffffffb9 value=0x0
| rtl_usb: Too few input end points found
| INFO: trying to register non-static key.
| the code is fine but needs lockdep annotation.
| turning off the locking correctness validator.
| CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.1.0-rc4-319354-g9a33b36 #3
| Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
| Google 01/01/2011
| Workqueue: usb_hub_wq hub_event
| Call Trace:
|   __dump_stack lib/dump_stack.c:77 [inline]
|   dump_stack+0xe8/0x16e lib/dump_stack.c:113
|   assign_lock_key kernel/locking/lockdep.c:786 [inline]
|   register_lock_class+0x11b8/0x1250 kernel/locking/lockdep.c:1095
|   __lock_acquire+0xfb/0x37c0 kernel/locking/lockdep.c:3582
|   lock_acquire+0x10d/0x2f0 kernel/locking/lockdep.c:4211
|   __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
|   _raw_spin_lock_irqsave+0x44/0x60 kernel/locking/spinlock.c:152
|   rtl_c2hcmd_launcher+0xd1/0x390
| drivers/net/wireless/realtek/rtlwifi/base.c:2344
|   rtl_deinit_core+0x25/0x2d0 drivers/net/wireless/realtek/rtlwifi/base.c:574
|   rtl_usb_probe.cold+0x861/0xa70
| drivers/net/wireless/realtek/rtlwifi/usb.c:1093
|   usb_probe_interface+0x31d/0x820 drivers/usb/core/driver.c:361
|   really_probe+0x2da/0xb10 drivers/base/dd.c:509
|   driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
|   __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
|   bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
|   __device_attach+0x223/0x3a0 drivers/base/dd.c:844
|   bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
|   device_add+0xad2/0x16e0 drivers/base/core.c:2106
|   usb_set_configuration+0xdf7/0x1740 drivers/usb/core/message.c:2021
|   generic_probe+0xa2/0xda drivers/usb/core/generic.c:210
|   usb_probe_device+0xc0/0x150 drivers/usb/core/driver.c:266
|   really_probe+0x2da/0xb10 drivers/base/dd.c:509
|   driver_probe_device+0x21d/0x350 drivers/base/dd.c:671
|   __device_attach_driver+0x1d8/0x290 drivers/base/dd.c:778
|   bus_for_each_drv+0x163/0x1e0 drivers/base/bus.c:454
|   __device_attach+0x223/0x3a0 drivers/base/dd.c:844
|   bus_probe_device+0x1f1/0x2a0 drivers/base/bus.c:514
|   device_add+0xad2/0x16e0 drivers/base/core.c:2106
|   usb_new_device.cold+0x537/0xccf drivers/usb/core/hub.c:2534
|   hub_port_connect drivers/usb/core/hub.c:5089 [inline]
|   hub_port_connect_change drivers/usb/core/hub.c:5204 [inline]
|   port_event drivers/usb/core/hub.c:5350 [inline]
|   hub_event+0x138e/0x3b00 drivers/usb/core/hub.c:5432
|   process_one_work+0x90f/0x1580 kernel/workqueue.c:2269
|   worker_thread+0x9b/0xe20 kernel/workqueue.c:2415
|   kthread+0x313/0x420 kernel/kthread.c:253
|   ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

Reported-by: syzbot+1fcc5ef45175fc774231@syzkaller.appspotmail.com
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index e24fda5e9087..34d68dbf4b4c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -1064,13 +1064,13 @@ int rtl_usb_probe(struct usb_interface *intf,
 	rtlpriv->cfg->ops->read_eeprom_info(hw);
 	err = _rtl_usb_init(hw);
 	if (err)
-		goto error_out;
+		goto error_out2;
 	rtl_usb_init_sw(hw);
 	/* Init mac80211 sw */
 	err = rtl_init_core(hw);
 	if (err) {
 		pr_err("Can't allocate sw for mac80211\n");
-		goto error_out;
+		goto error_out2;
 	}
 	if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
 		pr_err("Can't init_sw_vars\n");
@@ -1091,6 +1091,7 @@ int rtl_usb_probe(struct usb_interface *intf,
 
 error_out:
 	rtl_deinit_core(hw);
+error_out2:
 	_rtl_usb_io_handler_release(hw);
 	usb_put_dev(udev);
 	complete(&rtlpriv->firmware_loading_complete);
-- 
2.20.1


  parent reply	other threads:[~2019-07-15 14:12 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 14:00 [PATCH AUTOSEL 5.1 001/219] ath10k: Check tx_stats before use it Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 002/219] ath10k: htt: don't use txdone_fifo with SDIO Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 003/219] ath10k: fix incorrect multicast/broadcast rate setting Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 004/219] ath9k: Don't trust TX status TID number when reporting airtime Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 005/219] wil6210: fix potential out-of-bounds read Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 006/219] ath10k: Do not send probe response template for mesh Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 008/219] ath9k: Check for errors when reading SREV register Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 009/219] ath10k: Fix the wrong value of enums for wmi tlv stats id Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 010/219] wil6210: fix missed MISC mbox interrupt Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 011/219] ath6kl: add some bounds checking Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 012/219] ath10k: add peer id check in ath10k_peer_find_by_id Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 014/219] wil6210: fix spurious interrupts in 3-msi Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 015/219] ath: DFS JP domain W56 fixed pulse type 3 RADAR detection Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 016/219] ath10k: Fix encoding for protected management frames Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 018/219] batman-adv: fix for leaked TVLV handler Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 028/219] net: stmmac: dwmac1000: Clear unused address entries Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 029/219] net: stmmac: dwmac4/5: " Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 030/219] net: stmmac: Prevent missing interrupts when running NAPI Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 031/219] net: hns3: initialize CPU reverse mapping Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 032/219] qed: Set the doorbell address correctly Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 035/219] af_key: fix leaks in key_pol_get_resp and dump_sp Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 036/219] xfrm: Fix xfrm sel prefix length validation Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 042/219] Revert "e1000e: fix cyclic resets at link up with active tx" Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 043/219] e1000e: start network tx queue only when link is up Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 047/219] net: phy: Check against net_device being NULL Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 051/219] batman-adv: Fix duplicated OGMs on NETDEV_UP Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 055/219] net: hns3: add a check to pointer in error_detected and slot_reset Sasha Levin
2019-07-15 14:00 ` [PATCH AUTOSEL 5.1 056/219] net: hns3: set ops to null when unregister ad_dev Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 062/219] net: stmmac: dwmac4: fix flow control issue Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 063/219] net: stmmac: modify default value of tx-frames Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 065/219] net: fec: Do not use netdev messages too early Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 066/219] net: axienet: Fix race condition causing TX hang Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 069/219] net: sfp: add mutex to prevent concurrent state checks Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 070/219] ipset: Fix memory accounting for hash types on resize Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 083/219] bpf: silence warning messages in core Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 091/219] qed: iWARP - Fix tc for MPA ll2 connection Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 092/219] net: hns3: fix for dereferencing before null checking Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 093/219] net: hns3: fix for skb leak when doing selftest Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 094/219] net: hns3: delay ring buffer clearing during reset Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 097/219] xfrm: fix sa selector validation Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 105/219] vhost_net: disable zerocopy by default Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 106/219] iavf: allow null RX descriptors Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 109/219] bpf: fix callees pruning callers Sasha Levin
2019-07-15 14:01 ` [PATCH AUTOSEL 5.1 111/219] net: netsec: initialize tx ring on ndo_open Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 124/219] ipsec: select crypto ciphers for xfrm_algo Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 125/219] ipvs: defer hook registration to avoid leaks Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 138/219] net: stmmac: sun8i: force select external PHY when no internal one Sasha Levin
2019-07-15 14:02 ` Sasha Levin [this message]
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 140/219] mt7601u: do not schedule rx_tasklet when the device has been disconnected Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 142/219] mt7601u: fix possible memory leak when the device is disconnected Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 143/219] ipvs: fix tinfo memory leak in start_sync_thread Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 144/219] ath10k: add missing error handling Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 145/219] ath10k: fix fw crash by moving chip reset after napi disabled Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 146/219] ath10k: fix PCIE device wake up failed Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 153/219] netfilter: ctnetlink: Fix regression in conntrack entry deletion Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 154/219] xsk: Properly terminate assignment in xskq_produce_flush_desc Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 156/219] bpf: fix BPF_ALU32 | BPF_ARSH on BE arches Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 159/219] net/mlx5: Get vport ACL namespace by vport index Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 160/219] ixgbe: Check DDM existence in transceiver before access Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 164/219] ath9k: correctly handle short radar pulses Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 165/219] wil6210: drop old event after wmi_call timeout Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 173/219] net: hns3: fix a -Wformat-nonliteral compile warning Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 174/219] net: hns3: add some error checking in hclge_tm module Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 175/219] ath10k: Fix memory leak in qmi Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 176/219] ath10k: destroy sdio workqueue while remove sdio module Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 177/219] net: mvpp2: prs: Don't override the sign bit in SRAM parser shift Sasha Levin
2019-07-15 14:02 ` [PATCH AUTOSEL 5.1 178/219] igb: clear out skb->tstamp after reading the txtime Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 179/219] net: hns3: add Asym Pause support to fix autoneg problem Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 180/219] ixgbe: Avoid NULL pointer dereference with VF on non-IPsec hw Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 181/219] iwlwifi: mvm: Drop large non sta frames Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 182/219] bpf: fix uapi bpf_prog_info fields alignment Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 183/219] netfilter: Fix remainder of pseudo-header protocol 0 Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 184/219] iwlwifi: dbg: fix debug monitor stop and restart delays Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 185/219] bnxt_en: Disable bus master during PCI shutdown and driver unload Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 186/219] bnxt_en: Fix statistics context reservation logic for RDMA driver Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 192/219] vxlan: do not destroy fdb if register_netdevice() is failed Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 193/219] bnx2x: Prevent ptp_task to be rescheduled indefinitely Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 194/219] net: usb: asix: init MAC address buffers Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 196/219] libbpf: fix GCC8 warning for strncpy Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 197/219] bpf, libbpf, smatch: Fix potential NULL pointer dereference Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 198/219] selftests: bpf: fix inlines in test_lwt_seg6local Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 199/219] bonding: validate ip header before check IPPROTO_IGMP Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 202/219] tools: bpftool: Fix json dump crash on powerpc Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 203/219] net: hns3: enable broadcast promisc mode when initializing VF Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 207/219] Bluetooth: 6lowpan: search for destination address in all peers Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 210/219] Bluetooth: Check state in l2cap_disconnect_rsp Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 211/219] Bluetooth: hidp: NUL terminate a string in the compat ioctl Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 212/219] gtp: add missing gtp_encap_disable_sock() in gtp_encap_enable() Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 213/219] Bluetooth: validate BLE connection interval updates Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 214/219] gtp: fix suspicious RCU usage Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 215/219] gtp: fix Illegal context switch in RCU read-side critical section Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 216/219] gtp: fix use-after-free in gtp_encap_destroy() Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 217/219] gtp: fix use-after-free in gtp_newlink() Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 218/219] xdp: fix race on generic receive path Sasha Levin
2019-07-15 14:03 ` [PATCH AUTOSEL 5.1 219/219] net: mvmdio: defer probe of orion-mdio if a clock is not ready Sasha Levin

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=20190715140341.6443-139-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+1fcc5ef45175fc774231@syzkaller.appspotmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).