diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2013-09-04 15:55:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-17 07:47:45 -0700 |
commit | 9b276d2bd20ea2d20b45aab1b3c1700b7f2afa64 (patch) | |
tree | 9eec51a59b1adcab9a45910e37d6f7d281a7a491 /drivers/staging/rtl8188eu | |
parent | e255b0c6f745eac61a7971ff6f0f4f6bf9039374 (diff) |
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>
Diffstat (limited to 'drivers/staging/rtl8188eu')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_recv.c | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/recv_linux.c | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 201165787362..55851997f21c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -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; diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c b/drivers/staging/rtl8188eu/os_dep/recv_linux.c index e2f4e7d77170..c40ef1357117 100644 --- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c @@ -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; |