diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2013-09-04 15:56:10 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-17 07:47:45 -0700 |
commit | 9840093505bffa3f153bda2ac4046b868486150d (patch) | |
tree | 79b30537d5ab3e269e4aa7b846eb9e5f2ed10d7f /drivers/staging | |
parent | 937ebbdec50ed1f257277acba99eea4620f908a2 (diff) |
staging: r8188eu: Fix smatch warnings in core/rtw_recv.c
Smatch reports the following:
drivers/staging/rtl8188eu/core/rtw_recv.c:211 rtw_free_recvframe() warn: variable dereferenced before check 'precvframe' (see line 207)
drivers/staging/rtl8188eu/core/rtw_recv.c:1803 amsdu_to_msdu() warn: variable dereferenced before check 'sub_skb' (see line 1784)
The code was rearranged to eliminate the dereference before the check.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_recv.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 55851997f21c..ba8e53463d10 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -204,12 +204,14 @@ void rtw_init_recvframe(union recv_frame *precvframe, struct recv_priv *precvpri int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_queue) { unsigned long irqL; - struct adapter *padapter = precvframe->u.hdr.adapter; - struct recv_priv *precvpriv = &padapter->recvpriv; + struct adapter *padapter; + struct recv_priv *precvpriv; _func_enter_; if (!precvframe) return _FAIL; + padapter = precvframe->u.hdr.adapter; + precvpriv = &padapter->recvpriv; if (precvframe->u.hdr.pkt) { dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */ precvframe->u.hdr.pkt = NULL; @@ -1799,16 +1801,14 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe) memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN); } - /* Indicat the packets to upper layer */ - if (sub_skb) { - /* Insert NAT2.5 RX here! */ - sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev); - sub_skb->dev = padapter->pnetdev; + /* Indicate the packets to upper layer */ + /* Insert NAT2.5 RX here! */ + sub_skb->protocol = eth_type_trans(sub_skb, padapter->pnetdev); + sub_skb->dev = padapter->pnetdev; - sub_skb->ip_summed = CHECKSUM_NONE; + sub_skb->ip_summed = CHECKSUM_NONE; - netif_rx(sub_skb); - } + netif_rx(sub_skb); } exit: |