Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8712: Drop get_recvframe_data()

As done for rtl8723bs and r8188eu, drop get_recvframe_data(), as it
introduces an impossible value (NULL) for the compiler to check code
paths against which could result in nonsensical warnings.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: linux-staging@lists.linux.dev
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220118193327.2822099-4-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kees Cook and committed by
Greg Kroah-Hartman
a0c1fe18 c146ae45

+2 -10
+2 -2
drivers/staging/rtl8712/rtl871x_recv.c
··· 234 234 u16 ether_type; 235 235 236 236 pstapriv = &adapter->stapriv; 237 - ptr = get_recvframe_data(precv_frame); 237 + ptr = precv_frame->u.hdr.rx_data; 238 238 pfhdr = &precv_frame->u.hdr; 239 239 psta_addr = pfhdr->attrib.ta; 240 240 psta = r8712_get_stainfo(pstapriv, psta_addr); ··· 593 593 struct _adapter *adapter = precvframe->u.hdr.adapter; 594 594 struct mlme_priv *pmlmepriv = &adapter->mlmepriv; 595 595 596 - u8 *ptr = get_recvframe_data(precvframe); /*point to frame_ctrl field*/ 596 + u8 *ptr = precvframe->u.hdr.rx_data; /*point to frame_ctrl field*/ 597 597 struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; 598 598 599 599 if (pattrib->encrypt)
-8
drivers/staging/rtl8712/rtl871x_recv.h
··· 139 139 return precvframe->u.hdr.rx_head; 140 140 } 141 141 142 - static inline u8 *get_recvframe_data(union recv_frame *precvframe) 143 - { 144 - /* always return rx_data */ 145 - if (!precvframe) 146 - return NULL; 147 - return precvframe->u.hdr.rx_data; 148 - } 149 - 150 142 static inline u8 *recvframe_pull(union recv_frame *precvframe, sint sz) 151 143 { 152 144 /* used for extract sz bytes from rx_data, update rx_data and return