Merge pull request #30 from johnkeeping/sta-info-alignment

rtl8723ds: fix sta_info alignment
This commit is contained in:
lwfinger 2022-11-29 19:35:49 -06:00 committed by GitHub
commit 38231d5832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,13 +222,12 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
s32 i; s32 i;
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc(sizeof(struct sta_info) * NUM_STA + 4); pstapriv->pallocated_stainfo_buf = rtw_zvmalloc(sizeof(struct sta_info) * NUM_STA);
if (!pstapriv->pallocated_stainfo_buf) if (!pstapriv->pallocated_stainfo_buf)
return _FAIL; return _FAIL;
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 - pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf;
((SIZE_PTR)(pstapriv->pallocated_stainfo_buf) & 3);
_rtw_init_queue(&pstapriv->free_sta_queue); _rtw_init_queue(&pstapriv->free_sta_queue);
@ -423,7 +422,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
#endif #endif
if (pstapriv->pallocated_stainfo_buf) if (pstapriv->pallocated_stainfo_buf)
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info) * NUM_STA + 4); rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info) * NUM_STA);
} }
return _SUCCESS; return _SUCCESS;