staging: r8188eu: Fix a smatch warnings in core/rtw_recv.c

Smatch reports the following:
drivers/staging/rtl8188eu/os_dep/recv_linux.c:227 rtw_recv_indicatepkt() warn: variable dereferenced before check 'precv_frame' (see line 139)

The test in this location is removed and added in the free routine.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Larry Finger 2013-09-04 15:55:59 -05:00 committed by Greg Kroah-Hartman
parent e255b0c6f7
commit 9b276d2bd2
2 changed files with 3 additions and 3 deletions

View File

@ -208,7 +208,8 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_
struct recv_priv *precvpriv = &padapter->recvpriv;
_func_enter_;
if (!precvframe)
return _FAIL;
if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;

View File

@ -224,8 +224,7 @@ _func_exit_;
_recv_indicatepkt_drop:
/* enqueue back to free_recv_queue */
if (precv_frame)
rtw_free_recvframe(precv_frame, pfree_recv_queue);
rtw_free_recvframe(precv_frame, pfree_recv_queue);
_func_exit_;
return _FAIL;