From: Larry Finger Date: Wed, 30 Aug 2017 19:43:13 +0000 (-0500) Subject: staging: r8822be: Simplify deinit_priv() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a470ad21f980c1b642bf17eeda8e584b5566b701;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Ping-Ke Shih Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting Signed-off-by: Greg Kroah-Hartman --- 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)