staging: rtl8723bs: fix warning comparison to NULL
authorHariprasad Kelam <hariprasad.kelam@gmail.com>
Sun, 9 Jun 2019 12:48:51 +0000 (18:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Jun 2019 15:56:00 +0000 (17:56 +0200)
This patch fixes below issue reported by checkpatch

CHECK: Comparison to NULL could be written "!pxmitbuf->pallocated_buf"
+               if (pxmitbuf->pallocated_buf == NULL)

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/xmit_linux.c

index 4e4e565d991c765a0c234cd685699ab90fb78658..c125ac28e7dc786e89e782bac3b761627b4302b2 100644 (file)
@@ -50,7 +50,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
 {
        if (alloc_sz > 0) {
                pxmitbuf->pallocated_buf = rtw_zmalloc(alloc_sz);
-               if (pxmitbuf->pallocated_buf == NULL)
+               if (!pxmitbuf->pallocated_buf)
                        return _FAIL;
 
                pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);