All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Malcolm Priestley <tvboxspy@gmail.com>
Cc: devel@driverdev.osuosl.org
Subject: Re: [PATCH 5/5] staging: vt6656: set usb_set_intfdata on driver fail.
Date: Fri, 3 Jan 2020 11:01:59 +0100	[thread overview]
Message-ID: <20200103100159.GA882686@kroah.com> (raw)
In-Reply-To: <6de448d7-d833-ef2e-dd7b-3ef9992fee0e@gmail.com>

On Fri, Dec 20, 2019 at 09:15:59PM +0000, Malcolm Priestley wrote:
> 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>
> ---
>  drivers/staging/vt6656/device.h   | 1 +
>  drivers/staging/vt6656/main_usb.c | 1 +
>  drivers/staging/vt6656/wcmd.c     | 1 +
>  3 files changed, 3 insertions(+)
> 
> 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;
>  		}

You set this variable, but never reference it, so how does this change
any behavior in the driver?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2020-01-03 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 21:15 [PATCH 5/5] staging: vt6656: set usb_set_intfdata on driver fail Malcolm Priestley
2020-01-03 10:01 ` Greg Kroah-Hartman [this message]
2020-01-03 10:03   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200103100159.GA882686@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=tvboxspy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.