[PATCH] Staging: rtlwifi: Remove NULL pointer dereference

From: Shreeya Patel
Date: Mon Oct 09 2017 - 17:19:10 EST


Remove NULL pointer dereference as it results in undefined
behaviour, and will usually lead to a runtime error.

Signed-off-by: Shreeya Patel <shreeya.patel23498@xxxxxxxxx>
---
drivers/staging/rtlwifi/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c
index b88b0e8..5bb8f98 100644
--- a/drivers/staging/rtlwifi/base.c
+++ b/drivers/staging/rtlwifi/base.c
@@ -781,7 +781,7 @@ static void _rtl_txrate_selectmode(struct ieee80211_hw *hw,

struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
- struct rtl_sta_info *sta_entry = NULL;
+ struct rtl_sta_info *sta_entry;
u8 ratr_index = SET_RATE_ID(RATR_INX_WIRELESS_MC);

if (sta) {
--
2.7.4