Skip to content

Commit c0bcf9f

Browse files
Malcolm Priestleygregkh
authored andcommitted
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. Cc: stable <[email protected]> Signed-off-by: Malcolm Priestley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 07f59f1 commit c0bcf9f

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

drivers/staging/vt6656/device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ struct vnt_private {
259259
u8 mac_hw;
260260
/* netdev */
261261
struct usb_device *usb;
262+
struct usb_interface *intf;
262263

263264
u64 tsf_time;
264265
u8 rx_rate;

drivers/staging/vt6656/main_usb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
992992
priv = hw->priv;
993993
priv->hw = hw;
994994
priv->usb = udev;
995+
priv->intf = intf;
995996

996997
vnt_set_options(priv);
997998

drivers/staging/vt6656/wcmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ void vnt_run_command(struct work_struct *work)
9999
if (vnt_init(priv)) {
100100
/* If fail all ends TODO retry */
101101
dev_err(&priv->usb->dev, "failed to start\n");
102+
usb_set_intfdata(priv->intf, NULL);
102103
ieee80211_free_hw(priv->hw);
103104
return;
104105
}

0 commit comments

Comments
 (0)