Blob Blame History Raw
From a470ad21f980c1b642bf17eeda8e584b5566b701 Mon Sep 17 00:00:00 2001
From: Larry Finger <Larry.Finger@lwfinger.net>
Date: Wed, 30 Aug 2017 14:43:13 -0500
Subject: [PATCH] staging: r8822be: Simplify deinit_priv()
Git-commit: a470ad21f980c1b642bf17eeda8e584b5566b701
Patch-mainline: v4.14-rc1
References: FATE#326887

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>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/staging/rtlwifi/halmac/rtl_halmac.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/rtlwifi/halmac/rtl_halmac.c b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
index 2b1c5fae64ef..6448a8bfc14b 100644
--- a/drivers/staging/rtlwifi/halmac/rtl_halmac.c
+++ b/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)
-- 
2.19.1