3.16.84-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold johan@kernel.org
commit e93cd35101b61e4c79149be2cfc927c4b28dc60c upstream.
Make sure to stop both URBs before returning after failed probe as well as on disconnect to avoid use-after-free in the completion handler.
Reported-by: syzbot+b563b7f8dbe8223a51e8@syzkaller.appspotmail.com Fixes: a4302bff28e2 ("rsi: add bluetooth rx endpoint") Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver") Cc: Siva Rebbagondla siva.rebbagondla@redpinesignals.com Cc: Prameela Rani Garnepudi prameela.j04cs@gmail.com Cc: Amitkumar Karwar amit.karwar@redpinesignals.com Cc: Fariya Fatima fariyaf@gmail.com Signed-off-by: Johan Hovold johan@kernel.org Signed-off-by: Kalle Valo kvalo@codeaurora.org [bwh: Backported to 3.16: There is no BT support, so we only need to kill one URB on disconnect.] Signed-off-by: Ben Hutchings ben@decadent.org.uk --- --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -245,6 +245,14 @@ static void rsi_rx_done_handler(struct u rsi_set_event(&dev->rx_thread.event); }
+static void rsi_rx_urb_kill(struct rsi_hw *adapter) +{ + struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev; + struct urb *urb = dev->rx_usb_urb[0]; + + usb_kill_urb(urb); +} + /** * rsi_rx_urb_submit() - This function submits the given URB to the USB stack. * @adapter: Pointer to the adapter structure. @@ -510,6 +518,8 @@ static void rsi_disconnect(struct usb_in if (!adapter) return;
+ rsi_rx_urb_kill(adapter); + rsi_mac80211_detach(adapter); rsi_deinit_usb_interface(adapter); rsi_91x_deinit(adapter);