Skip to content

Commit

Permalink
staging: vt6656: set usb_set_intfdata on driver fail.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Malcolm Priestley authored and Greg Kroah-Hartman committed Jan 3, 2020
1 parent 07f59f1 commit c0bcf9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/vt6656/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/vt6656/main_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/vt6656/wcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c0bcf9f

Please sign in to comment.