Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b276d2b authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman
Browse files

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: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e255b0c6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
+1 −2
Original line number Diff line number Diff line
@@ -224,7 +224,6 @@ _func_exit_;
_recv_indicatepkt_drop:

	 /* enqueue back to free_recv_queue */
	if (precv_frame)
	rtw_free_recvframe(precv_frame, pfree_recv_queue);

_func_exit_;