Search Linux Wireless

Re: [PATCH] wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 08, 2023 at 10:58:52AM +0800, Jinjie Ruan wrote:
> Both usb_kill_urb() and usb_free_urb() do the NULL check itself, so there
> is no need to duplicate it prior to calling.
> 
> Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support")
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
> ---
>  drivers/net/wireless/realtek/rtw88/usb.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)

Acked-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Sascha

> 
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index d879d7e3dc81..e6ab1ac6d709 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -611,8 +611,7 @@ static void rtw_usb_cancel_rx_bufs(struct rtw_usb *rtwusb)
>  
>  	for (i = 0; i < RTW_USB_RXCB_NUM; i++) {
>  		rxcb = &rtwusb->rx_cb[i];
> -		if (rxcb->rx_urb)
> -			usb_kill_urb(rxcb->rx_urb);
> +		usb_kill_urb(rxcb->rx_urb);
>  	}
>  }
>  
> @@ -623,10 +622,8 @@ static void rtw_usb_free_rx_bufs(struct rtw_usb *rtwusb)
>  
>  	for (i = 0; i < RTW_USB_RXCB_NUM; i++) {
>  		rxcb = &rtwusb->rx_cb[i];
> -		if (rxcb->rx_urb) {
> -			usb_kill_urb(rxcb->rx_urb);
> -			usb_free_urb(rxcb->rx_urb);
> -		}
> +		usb_kill_urb(rxcb->rx_urb);
> +		usb_free_urb(rxcb->rx_urb);
>  	}
>  }
>  
> -- 
> 2.34.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux