diff mbox series

Revert "usb: dwc2: host: Setting qtd to NULL after freeing it"

Message ID 1559163283-2429-1-git-send-email-linux@roeck-us.net (mailing list archive)
State Mainlined
Commit ad408a1596b45868e38d0504f2ec1d5fb06f17d4
Headers show
Series Revert "usb: dwc2: host: Setting qtd to NULL after freeing it" | expand

Commit Message

Guenter Roeck May 29, 2019, 8:54 p.m. UTC
This reverts commit b0d659022e5c96ee5c4bd62d22d3da2d66de306b.

The reverted commit does nothing but adding two unnecessary lines
of code.  It sets a local variable to NULL in two functions, but
that variable is not used anywhere in the rest of those functions.
This is just confusing, so let's remove it.

Cc: Vardan Mikayelyan <mvardan@synopsys.com>
Cc: John Youn <johnyoun@synopsys.com>
Cc: Douglas Anderson <dianders@chromiun.org>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/usb/dwc2/hcd.c | 1 -
 drivers/usb/dwc2/hcd.h | 1 -
 2 files changed, 2 deletions(-)

Comments

Doug Anderson May 29, 2019, 9 p.m. UTC | #1
Hi,

On Wed, May 29, 2019 at 1:54 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> This reverts commit b0d659022e5c96ee5c4bd62d22d3da2d66de306b.
>
> The reverted commit does nothing but adding two unnecessary lines
> of code.  It sets a local variable to NULL in two functions, but
> that variable is not used anywhere in the rest of those functions.
> This is just confusing, so let's remove it.
>
> Cc: Vardan Mikayelyan <mvardan@synopsys.com>
> Cc: John Youn <johnyoun@synopsys.com>
> Cc: Douglas Anderson <dianders@chromiun.org>
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/usb/dwc2/hcd.c | 1 -
>  drivers/usb/dwc2/hcd.h | 1 -
>  2 files changed, 2 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Minas Harutyunyan May 30, 2019, 2:21 p.m. UTC | #2
On 5/30/2019 12:55 AM, Guenter Roeck wrote:
> This reverts commit b0d659022e5c96ee5c4bd62d22d3da2d66de306b.
> 
> The reverted commit does nothing but adding two unnecessary lines
> of code.  It sets a local variable to NULL in two functions, but
> that variable is not used anywhere in the rest of those functions.
> This is just confusing, so let's remove it.
> 
> Cc: Vardan Mikayelyan <mvardan@synopsys.com>
> Cc: John Youn <johnyoun@synopsys.com>
> Cc: Douglas Anderson <dianders@chromiun.org>
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Acked-by: Minas Harutyunyan <hminas@synopsys.com>


> ---
>   drivers/usb/dwc2/hcd.c | 1 -
>   drivers/usb/dwc2/hcd.h | 1 -
>   2 files changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index b50ec3714fd8..bca64b0d4d15 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -4676,7 +4676,6 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
>   	spin_unlock_irqrestore(&hsotg->lock, flags);
>   	urb->hcpriv = NULL;
>   	kfree(qtd);
> -	qtd = NULL;
>   fail1:
>   	if (qh_allocated) {
>   		struct dwc2_qtd *qtd2, *qtd2_tmp;
> diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h
> index c089ffa1f0a8..f6bc48432b04 100644
> --- a/drivers/usb/dwc2/hcd.h
> +++ b/drivers/usb/dwc2/hcd.h
> @@ -574,7 +574,6 @@ static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
>   {
>   	list_del(&qtd->qtd_list_entry);
>   	kfree(qtd);
> -	qtd = NULL;
>   }
>   
>   /* Descriptor DMA support functions */
>
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index b50ec3714fd8..bca64b0d4d15 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -4676,7 +4676,6 @@  static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
 	spin_unlock_irqrestore(&hsotg->lock, flags);
 	urb->hcpriv = NULL;
 	kfree(qtd);
-	qtd = NULL;
 fail1:
 	if (qh_allocated) {
 		struct dwc2_qtd *qtd2, *qtd2_tmp;
diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h
index c089ffa1f0a8..f6bc48432b04 100644
--- a/drivers/usb/dwc2/hcd.h
+++ b/drivers/usb/dwc2/hcd.h
@@ -574,7 +574,6 @@  static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
 {
 	list_del(&qtd->qtd_list_entry);
 	kfree(qtd);
-	qtd = NULL;
 }
 
 /* Descriptor DMA support functions */