mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
staging: rtl8712: Replace kmalloc with kmalloc_array
Replace kmalloc with specialized function kmalloc_array when the size is a multiplication of: number_of_elements * size_of_element Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
614a291090
commit
ada40ba4e5
1 changed files with 2 additions and 2 deletions
|
@ -62,7 +62,7 @@ static sint _init_mlme_priv(struct _adapter *padapter)
|
||||||
_init_queue(&(pmlmepriv->scanned_queue));
|
_init_queue(&(pmlmepriv->scanned_queue));
|
||||||
set_scanned_network_val(pmlmepriv, 0);
|
set_scanned_network_val(pmlmepriv, 0);
|
||||||
memset(&pmlmepriv->assoc_ssid, 0, sizeof(struct ndis_802_11_ssid));
|
memset(&pmlmepriv->assoc_ssid, 0, sizeof(struct ndis_802_11_ssid));
|
||||||
pbuf = kmalloc(MAX_BSS_CNT * (sizeof(struct wlan_network)),
|
pbuf = kmalloc_array(MAX_BSS_CNT, sizeof(struct wlan_network),
|
||||||
GFP_ATOMIC);
|
GFP_ATOMIC);
|
||||||
if (pbuf == NULL)
|
if (pbuf == NULL)
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
|
|
Loading…
Reference in a new issue