Browse Source

staging: r8822be: Simplify deinit_priv()

Now that the extraneous debugging code is removed, routine deinit_priv()
clearly contains code that serves no useful purpose.

A null test before a call to kfree() and a spurious cast are also removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger 8 years ago
parent
commit
a470ad21f9
1 changed files with 1 additions and 7 deletions
  1. 1 7
      drivers/staging/rtlwifi/halmac/rtl_halmac.c

+ 1 - 7
drivers/staging/rtlwifi/halmac/rtl_halmac.c

@@ -382,13 +382,7 @@ static void deinit_priv(struct rtl_halmac *halmac)
 
 	indicator = halmac->indicator;
 	halmac->indicator = NULL;
-	if (indicator) {
-		u32 count, size;
-
-		count = HALMAC_FEATURE_ALL + 1;
-		size = sizeof(*indicator) * count;
-		kfree((u8 *)indicator);
-	}
+	kfree(indicator);
 }
 
 int rtl_halmac_init_adapter(struct rtl_priv *rtlpriv)