Re: [PATCH] staging: r8188eu: Remove null checking before freeing functions
From: Greg Kroah-Hartman
Date: Sun Jun 26 2022 - 04:21:09 EST
On Sun, Jun 26, 2022 at 01:14:11PM +0530, SebinSebastian wrote:
> Fix the following coccicheck warning:
> drivers/staging/r8188eu/os_dep/usb_intf.c:376:2-7: WARNING: NULL check before some freeing functions is not needed.
>
> Signed-off-by: Sebin Sebastian <mailmesebin00@xxxxxxxxx>
> ---
> drivers/staging/r8188eu/os_dep/usb_intf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
> index 68869c5daeff..f5f1119b5444 100644
> --- a/drivers/staging/r8188eu/os_dep/usb_intf.c
> +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
> @@ -372,8 +372,8 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
> free_adapter:
> if (pnetdev)
> rtw_free_netdev(pnetdev);
> - else if (padapter)
> - vfree(padapter);
> +
> + vfree(padapter);
You introduced another coding style issue, and you changed the logic to
be different here. Are you sure you want this change to be accepted?
thanks,
greg k-h