Commit a9788a98 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Khalid Elmously

staging: vt6656: set usb_set_intfdata on driver fail.

BugLink: https://bugs.launchpad.net/bugs/1859865

commit c0bcf9f3 upstream.

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: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/6de448d7-d833-ef2e-dd7b-3ef9992fee0e@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 0aed6e1d
...@@ -272,6 +272,7 @@ struct vnt_private { ...@@ -272,6 +272,7 @@ struct vnt_private {
u8 mac_hw; u8 mac_hw;
/* netdev */ /* netdev */
struct usb_device *usb; struct usb_device *usb;
struct usb_interface *intf;
u64 tsf_time; u64 tsf_time;
u8 rx_rate; u8 rx_rate;
......
...@@ -979,6 +979,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -979,6 +979,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
priv = hw->priv; priv = hw->priv;
priv->hw = hw; priv->hw = hw;
priv->usb = udev; priv->usb = udev;
priv->intf = intf;
vnt_set_options(priv); vnt_set_options(priv);
......
...@@ -113,6 +113,7 @@ void vnt_run_command(struct work_struct *work) ...@@ -113,6 +113,7 @@ void vnt_run_command(struct work_struct *work)
if (vnt_init(priv)) { if (vnt_init(priv)) {
/* If fail all ends TODO retry */ /* If fail all ends TODO retry */
dev_err(&priv->usb->dev, "failed to start\n"); dev_err(&priv->usb->dev, "failed to start\n");
usb_set_intfdata(priv->intf, NULL);
ieee80211_free_hw(priv->hw); ieee80211_free_hw(priv->hw);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment