Skip to contentSkip to conversation

patch "staging: vt6656: set usb_set_intfdata on driver fail." added to staging-linus

PATCH [email protected] 1 participant 1 message Jan 3, 2020

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

staging: vt6656: set usb_set_intfdata on driver fail.

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From c0bcf9f3f5b661d4ace2a64a79ef661edd2a4dc8 Mon Sep 17 00:00:00 2001
From: Malcolm Priestley <[email protected]>
Date: Fri, 20 Dec 2019 21:15:59 +0000
Subject: staging: vt6656: set usb_set_intfdata on driver fail.

intfdata will contain stale pointer when the device is detached after failed initialization when referenced in vt6656_disconnect

Provide driver access to it here and NULL it.

---
 drivers/staging/vt6656/device.h   | 1 +
 drivers/staging/vt6656/main_usb.c | 1 +
 drivers/staging/vt6656/wcmd.c     | 1 +
 3 files changed, 3 insertions(+)
drivers/staging/vt6656/device.h +1 -0
index 6074ceda78bf..50e1c8918040 100644
@@ -259,6 +259,7 @@ struct vnt_private {
 	u8 mac_hw;
 	/* netdev */
 	struct usb_device *usb;
+	struct usb_interface *intf;
 
 	u64 tsf_time;
 	u8 rx_rate;
drivers/staging/vt6656/main_usb.c +1 -0
index 4a5d741f94f5..9cb924c54571 100644
@@ -992,6 +992,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	priv = hw->priv;
 	priv->hw = hw;
 	priv->usb = udev;
+	priv->intf = intf;
 
 	vnt_set_options(priv);
 
drivers/staging/vt6656/wcmd.c +1 -0
index 3eb2f11a5de1..2c5250ca2801 100644
@@ -99,6 +99,7 @@ void vnt_run_command(struct work_struct *work)
 		if (vnt_init(priv)) {
 			/* If fail all ends TODO retry */
 			dev_err(&priv->usb->dev, "failed to start\n");
+			usb_set_intfdata(priv->intf, NULL);
 			ieee80211_free_hw(priv->hw);
 			return;
 		}
Signature · 1 line
2.24.1