lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220401094248.GT3293@kadam>
Date:   Fri, 1 Apr 2022 12:42:48 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     xkernel.wang@...mail.com
Cc:     gregkh@...uxfoundation.org, Larry.Finger@...inger.net,
        florian.c.schilhabel@...glemail.com, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] staging: rtl8712: fix potential memory leak in
 r8712_init_drv_sw()

On Fri, Apr 01, 2022 at 01:08:19AM +0800, xkernel.wang@...mail.com wrote:
>  	ret = _r8712_init_sta_priv(&padapter->stapriv);
>  	if (ret)
> -		return ret;
> +		goto free_recv_priv;
>  	padapter->stapriv.padapter = padapter;
>  	r8712_init_bcmc_stainfo(padapter);
>  	r8712_init_pwrctrl_priv(padapter);
> @@ -328,6 +328,18 @@ int r8712_init_drv_sw(struct _adapter *padapter)
>  	init_default_value(padapter);
>  	r8712_InitSwLeds(padapter);
>  	return ret;

Not related to the patch.  (You didn't introduce this, so it's not
something you need to fix.)  But this "return ret;" would be better if
it were "return 0;"

regards,
dan carpenter


> +
> +free_recv_priv:
> +	_r8712_free_recv_priv(&padapter->recvpriv);
> +free_xmit_priv:
> +	_free_xmit_priv(&padapter->xmitpriv);
> +free_mlme_priv:
> +	r8712_free_mlme_priv(&padapter->mlmepriv);
> +free_evt_priv:
> +	r8712_free_evt_priv(&padapter->evtpriv);
> +free_cmd_priv:
> +	r8712_free_cmd_priv(&padapter->cmdpriv);
> +	return ret;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ