diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2019-12-20 21:15:59 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-03 11:46:59 +0100 |
commit | c0bcf9f3f5b661d4ace2a64a79ef661edd2a4dc8 (patch) | |
tree | b3fa20a0555a959c3c0aeedb195b5179a9efbff0 /drivers/staging/vt6656 | |
parent | 07f59f180ee083c48c32a1e69ae1d0091444d212 (diff) | |
download | linux-c0bcf9f3f5b661d4ace2a64a79ef661edd2a4dc8.tar.gz linux-c0bcf9f3f5b661d4ace2a64a79ef661edd2a4dc8.tar.bz2 linux-c0bcf9f3f5b661d4ace2a64a79ef661edd2a4dc8.zip |
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 <stable@vger.kernel.org>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/6de448d7-d833-ef2e-dd7b-3ef9992fee0e@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/device.h | 1 | ||||
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 1 | ||||
-rw-r--r-- | drivers/staging/vt6656/wcmd.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index 6074ceda78bf..50e1c8918040 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -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; diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 4a5d741f94f5..9cb924c54571 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -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); diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 3eb2f11a5de1..2c5250ca2801 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -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; } |