3.16.84-rc1 review patch.  If anyone has any objections, please let me know.

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

From: Johan Hovold <[email protected]>

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: [email protected]
Fixes: a4302bff28e2 ("rsi: add bluetooth rx endpoint")
Fixes: dad0d04fa7ba ("rsi: Add RS9113 wireless driver")
Cc: Siva Rebbagondla <[email protected]>
Cc: Prameela Rani Garnepudi <[email protected]>
Cc: Amitkumar Karwar <[email protected]>
Cc: Fariya Fatima <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
[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 <[email protected]>
---
--- 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);

Reply via email to