staging: rtl8723bs: remove redundant kfree check in rtw_xmit.c
PATCH 1/1 staging: rtl8723bs: remove redundant kfree check in rtw_xmit.c
Remove the redundant null check before calling kfree. ccheckpatch reminds us that kfree(NULL) is safe and this check is not required.
Signed-off-by Andrezinrc <[email protected]>
--- drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +2 -3
@@ -1736,10 +1736,9 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram pxmitframe->pkt =NULL ; } -if (pxmitframe->alloc_addr) { -kfree (pxmitframe->alloc_addr); +kfree (pxmitframe->alloc_addr); +if (pxmitframe->alloc_addr) goto check_pkt_complete; - }if (pxmitframe->ext_tag ==0 ) queue = &pxmitpriv->free_xmit_queue;
Signature · 1 line
2.43.0
Quoted 13 lines · Andrezinrc
Remove the redundant null check before calling kfree. ccheckpatch reminds us that kfree(NULL) is safe and this check is not required.
Signed-off-by Andrezinrc <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/staging/rtl8723bs/core/rtw_xmit.c +0
-0
drivers/staging/rtl8723bs/core/rtw_xmit.c s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram · line 1742
Quoted 9 lines
drivers/staging/rtl8723bs/core/rtw_xmit.c +2
-3@@ -1736,10 +1736,9 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram pxmitframe->pkt =NULL ; } -if (pxmitframe->alloc_addr) { -kfree (pxmitframe->alloc_addr); +kfree (pxmitframe->alloc_addr); +if (pxmitframe->alloc_addr) goto check_pkt_complete; - }
The code was more readable before.
regards,
dan carpenter