rtl8188eu: Fix NULL pointer

User hlguo reports crashes due to a NULL pointer dereference. This should fix it.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-01-22 22:13:56 -06:00
parent c83976d1df
commit bb55393afa

View file

@ -1601,6 +1601,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, struct recv_fr
prtnframe = NULL; prtnframe = NULL;
} else { } else {
/* can't find this ta's defrag_queue, so free this recv_frame */ /* can't find this ta's defrag_queue, so free this recv_frame */
if (precv_frame && pfree_recv_queue)
rtw_free_recvframe(precv_frame, pfree_recv_queue); rtw_free_recvframe(precv_frame, pfree_recv_queue);
prtnframe = NULL; prtnframe = NULL;
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q==NULL: ismfrag=%d, fragnum=%d\n", ismfrag, fragnum)); RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q==NULL: ismfrag=%d, fragnum=%d\n", ismfrag, fragnum));
@ -1620,6 +1621,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, struct recv_fr
prtnframe = precv_frame; prtnframe = precv_frame;
} else { } else {
/* can't find this ta's defrag_queue, so free this recv_frame */ /* can't find this ta's defrag_queue, so free this recv_frame */
if (precv_frame && pfree_recv_queue)
rtw_free_recvframe(precv_frame, pfree_recv_queue); rtw_free_recvframe(precv_frame, pfree_recv_queue);
prtnframe = NULL; prtnframe = NULL;
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q==NULL: ismfrag=%d, fragnum=%d\n", ismfrag, fragnum)); RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q==NULL: ismfrag=%d, fragnum=%d\n", ismfrag, fragnum));
@ -1630,6 +1632,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, struct recv_fr
/* after defrag we must check tkip mic code */ /* after defrag we must check tkip mic code */
if (recvframe_chkmic(padapter, prtnframe) == _FAIL) { if (recvframe_chkmic(padapter, prtnframe) == _FAIL) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic(padapter, prtnframe)==_FAIL\n")); RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic(padapter, prtnframe)==_FAIL\n"));
if (precv_frame && pfree_recv_queue)
rtw_free_recvframe(prtnframe, pfree_recv_queue); rtw_free_recvframe(prtnframe, pfree_recv_queue);
prtnframe = NULL; prtnframe = NULL;
} }