OSDN Git Service

staging: r8188eu: core: remove null check before vfree
authorSaurav Girepunje <saurav.girepunje@gmail.com>
Sun, 29 Aug 2021 17:00:09 +0000 (22:30 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Sep 2021 06:49:42 +0000 (08:49 +0200)
Remove NULL check. NULL check before freeing function is not needed.
Correct the indentation.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YSu9GQa1A3s6FYQx@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_sta_mgt.c

index f6dffed..c3600cb 100644 (file)
@@ -155,9 +155,8 @@ u32 _rtw_free_sta_priv(struct       sta_priv *pstapriv)
                spin_unlock_bh(&pstapriv->sta_hash_lock);
                /*===============================*/
 
-               if (pstapriv->pallocated_stainfo_buf)
-                       vfree(pstapriv->pallocated_stainfo_buf);
-               }
+               vfree(pstapriv->pallocated_stainfo_buf);
+       }
 
        return _SUCCESS;
 }