Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3941383ybg; Mon, 28 Oct 2019 23:05:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi3l2vR5pWPX6jk5NEzxjtggR0OApsNlf06V0vl+tqeVt6HlFg3ysg+3sLfOoSLBuedmJZ X-Received: by 2002:a17:906:2cd2:: with SMTP id r18mr1507554ejr.282.1572329100989; Mon, 28 Oct 2019 23:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572329100; cv=none; d=google.com; s=arc-20160816; b=LbGEFonY6E6Oz3r1sxX2g3Yq+idlSuplIjfZFG9moYBTddM2B7lGLwIAjpsiCTrpeq S+GWOUf/ZAzGaw9pQgSPytB1OqeEYFRnC+2GHI08LzYPVnBF3xM7/UXHR3Wmc+vyqgiQ PJbyxXdffX23I2QV1gNAAe/ZGgXFrViGaBw/z/DjdY8g57u6HutGGPVJvNbD+aC/tFFz V8WRG8IZUgEG5pQEhL+D5VlxsiYX1okbjsAwjt/yV/TeVSBzyWYCZLsEr/EHCONSK/We QB4FC6SaSu8LtTbCRFu0F5igkwwoZdEamtFuUhsOkx5wR2CjMKfDYdMsU/PpwJwYID5v QiyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wJ7KTeNg41xpnLNdwD+WISXT76U1wpRH4wPOAULG0gg=; b=gGwhgDiofbleKba7dhvGK3J8Eg/E7JZqeF5vN34OXQJFTpvuWiybvWK+mfM4fwNfs6 P7RJQ77AGERZlKnjd3QVeYtcJ//77Y9mYFK/HTIxDxOt1PnM2y8K52C5JEKlfXiEYV4C yiEorjMv2IVpRlGe0OIE09Q7cS4ABv/i+dYV+thmf839mVAr/l6Rm9BVkhD4eR/zU2M+ mphW1pmSx1Hh485MXzpuyuptTCUmrLfzSamn2coWIOpFrStlgneUsJljV74iAdY23MzV R5tN4eeQYVBKiLSDmXrpooGBZk6iKSOzmR5KwyENwoeSe9Vy4e7IxUkTtBj9D3GWl3yo wqkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W6y+eyGC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si7594990ejd.17.2019.10.28.23.04.33; Mon, 28 Oct 2019 23:05:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W6y+eyGC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390906AbfJ1QYh (ORCPT + 99 others); Mon, 28 Oct 2019 12:24:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:42304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728653AbfJ1QYh (ORCPT ); Mon, 28 Oct 2019 12:24:37 -0400 Received: from localhost (100.50.158.77.rev.sfr.net [77.158.50.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4153B214E0; Mon, 28 Oct 2019 16:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572279876; bh=GtCFoGMERsUGxgb1hU/OwPPBWzySYFGHXpzD+cvXinM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W6y+eyGCxJom/VV4tXpf2cMMHMwElQH3gocwgluoH4gY/G2VrIAAjKnDErtp3JrWg LuNqKEfD5Fk7AkcAGHOwQB3L4z0k6pUjKT2HEPoh+ZJwDfmyhOWbyJQ3FfmqBdfl1U gWQXO/f5sqWiAS5KLZyuKyf3FQfAz4+YkOBNrXpo= Date: Mon, 28 Oct 2019 17:24:34 +0100 From: Greg KH To: zhong jiang Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8723bs: remove an redundant null check before kfree() Message-ID: <20191028162434.GB321492@kroah.com> References: <1571211506-19005-1-git-send-email-zhongjiang@huawei.com> <20191025024216.GB331827@kroah.com> <5DB711AE.1040904@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5DB711AE.1040904@huawei.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 29, 2019 at 12:05:02AM +0800, zhong jiang wrote: > On 2019/10/25 10:42, Greg KH wrote: > > On Wed, Oct 16, 2019 at 03:38:26PM +0800, zhong jiang wrote: > >> kfree() has taken null pointer into account. hence it is safe to remove > >> the unnecessary check. > >> > >> Signed-off-by: zhong jiang > >> --- > >> drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +-- > >> 1 file changed, 1 insertion(+), 2 deletions(-) > >> > >> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c > >> index 7011c2a..4597f4f 100644 > >> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c > >> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c > >> @@ -2210,8 +2210,7 @@ void rtw_free_hwxmits(struct adapter *padapter) > >> struct xmit_priv *pxmitpriv = &padapter->xmitpriv; > >> > >> hwxmits = pxmitpriv->hwxmits; > >> - if (hwxmits) > >> - kfree(hwxmits); > >> + kfree(hwxmits); > >> } > >> > >> void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry) > >> -- > >> 1.7.12.4 > >> > > Patch does not apply to my tree :( > > > > . > > > Greg, Could you apply the patch to your tree ? It did not apply, so what do you want me to do with it? confused, greg k-h