staging:r8188eu: remove pallocated_recv_buf member of the recv_priv structure

recv_priv used instead.
recv_priv does not changed after assigning
and it can be used as kfree argument

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ivan Safonov 2016-10-08 01:01:26 +07:00 committed by Greg Kroah-Hartman
parent 63764c7fb6
commit 94b6a662c3
2 changed files with 3 additions and 8 deletions

View File

@ -37,18 +37,14 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
/* init recv_buf */ /* init recv_buf */
_rtw_init_queue(&precvpriv->free_recv_buf_queue); _rtw_init_queue(&precvpriv->free_recv_buf_queue);
precvpriv->pallocated_recv_buf = precvpriv->precv_buf =
kcalloc(NR_RECVBUFF, sizeof(struct recv_buf), GFP_KERNEL); kcalloc(NR_RECVBUFF, sizeof(struct recv_buf), GFP_KERNEL);
if (!precvpriv->pallocated_recv_buf) { if (!precvpriv->precv_buf) {
res = _FAIL; res = _FAIL;
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
("alloc recv_buf fail!\n")); ("alloc recv_buf fail!\n"));
goto exit; goto exit;
} }
precvpriv->precv_buf = (struct recv_buf *)precvpriv->pallocated_recv_buf;
precvbuf = precvpriv->precv_buf; precvbuf = precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) { for (i = 0; i < NR_RECVBUFF; i++) {
@ -93,7 +89,7 @@ void rtw_hal_free_recv_priv(struct adapter *padapter)
precvbuf++; precvbuf++;
} }
kfree(precvpriv->pallocated_recv_buf); kfree(precvpriv->precv_buf);
if (skb_queue_len(&precvpriv->rx_skb_queue)) if (skb_queue_len(&precvpriv->rx_skb_queue))
DBG_88E(KERN_WARNING "rx_skb_queue not empty\n"); DBG_88E(KERN_WARNING "rx_skb_queue not empty\n");

View File

@ -180,7 +180,6 @@ struct recv_priv {
struct tasklet_struct recv_tasklet; struct tasklet_struct recv_tasklet;
struct sk_buff_head free_recv_skb_queue; struct sk_buff_head free_recv_skb_queue;
struct sk_buff_head rx_skb_queue; struct sk_buff_head rx_skb_queue;
u8 *pallocated_recv_buf;
struct recv_buf *precv_buf; /* 4 alignment */ struct recv_buf *precv_buf; /* 4 alignment */
struct __queue free_recv_buf_queue; struct __queue free_recv_buf_queue;
/* For display the phy informatiom */ /* For display the phy informatiom */