Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753893AbbHRQ7B (ORCPT ); Tue, 18 Aug 2015 12:59:01 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:33690 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753850AbbHRQ65 (ORCPT ); Tue, 18 Aug 2015 12:58:57 -0400 From: =?UTF-8?q?Rapha=C3=ABl=20Beamonte?= To: Greg Kroah-Hartman Cc: =?UTF-8?q?Rapha=C3=ABl=20Beamonte?= , Ksenija Stanojevic , Joe Perches , Cristina Opriceana , Greg Donald , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [PATCHv2 12/19] staging: rtl8192u: r8192U_core: fix unnecessary check before kfree code style issue Date: Tue, 18 Aug 2015 12:58:13 -0400 Message-Id: <5ea21c0a1265457cad6a03edcfaac3ba3f25ff93.1439880735.git.raphael.beamonte@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1328 Lines: 47 kfree(NULL) is safe and the checks were not required. Signed-off-by: Raphaƫl Beamonte --- drivers/staging/rtl8192u/r8192U_core.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index cd14c0a..d0020f1 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1724,10 +1724,9 @@ static void rtl8192_usb_deleteendpoints(struct net_device *dev) } kfree(priv->oldaddr); priv->oldaddr = NULL; - if (priv->pp_rxskb) { - kfree(priv->pp_rxskb); - priv->pp_rxskb = NULL; - } + + kfree(priv->pp_rxskb); + priv->pp_rxskb = NULL; } #else void rtl8192_usb_deleteendpoints(struct net_device *dev) @@ -1752,11 +1751,9 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev) priv->rx_urb = NULL; kfree(priv->oldaddr); priv->oldaddr = NULL; - if (priv->pp_rxskb) { - kfree(priv->pp_rxskb); - priv->pp_rxskb = 0; - } + kfree(priv->pp_rxskb); + priv->pp_rxskb = 0; #endif } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/