Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4154749ybg; Tue, 29 Oct 2019 03:01:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSFfcLXCUxl15poJ0g7AoKUIW+j2/mol7hbMzWJ8LB+Q44qIhWxemZkKiuEZhfdS7rgWBn X-Received: by 2002:a17:907:38a:: with SMTP id ss10mr2346361ejb.325.1572343284580; Tue, 29 Oct 2019 03:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572343284; cv=none; d=google.com; s=arc-20160816; b=xy8VaR9uPDWYC+Q0Tiy/YJ8IvOazVJjBTWyyNDbcENDVKTidwIx8CLJY9Mw3+ik5dr rnFhScBtNRR02YJvC8JJf+X5ozbXPMg77IohOMxOyJwnhOaLWkim0pQLE48W/F9cskuY 8Z1qxOKcT7MKmBIj4X6/RSXtj/DoKoedsrIFUUy752HrehDYkTp909C4vPJd2cmc9hxj 2P3R+VObT6lWmpUR1gacIrDE2/DdvObmNzmVC5NEg04XRlgsHLRh3HfaddOqHPHJO/aw fgfWmvqTE3Y7Au61u0f+FncgVa8ckJhhykcCtjeRah1t866Un+ibRabNXXovu3XI0UUE 9IfQ== 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=plqpBpE5VGV50zVXNCZAtVGYJMfNxz89AALFLtnzoXc=; b=HyF9qfdcvqU4qOzVGQHvkSvcGNxV9bH8T6Yu29q8hSMLVSpbel1Cc1ARCGrGCa1hz8 ZO5fx5H82Zx3fjjs34S5O233MZ439Ne2RCFITWl4v8iqktuE6ZIoLwgZkO7c2GzHIcYS xaL2bOXa9vOGC8Dk5VU0bqp3yjJqY+BLI9wKsiXwjmYQqjgADyLs7qJUBTfDvZ5sU62P dZ1udzdQmcu6HcyiQz2HszlJuTdXRkub76kwRC9yyk0kIxBZdr+4Abzu2jUfeYxUwwtX Fi6nsx56w7oT1bvZfgtfjMmMq2zgnjxKbsAdKymqpPVcElazq3cgUvq46Nw6aAnVG/Xi eK9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UIko7I3w; 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 b19si7260139eje.396.2019.10.29.03.01.00; Tue, 29 Oct 2019 03:01:24 -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=UIko7I3w; 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 S1728574AbfJ2IGi (ORCPT + 99 others); Tue, 29 Oct 2019 04:06:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:51708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726246AbfJ2IGi (ORCPT ); Tue, 29 Oct 2019 04:06:38 -0400 Received: from localhost (unknown [91.217.168.176]) (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 28FDE20663; Tue, 29 Oct 2019 08:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572336397; bh=A0tcD1zkhuDHdu3AWDJcL5XsJuzo5bpmTakxBWfkeGc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UIko7I3wI8kuAH1op4qGk30onCjabcIebu6TGrY+DeHfRUQ9ALBsU/O2Kvxo/0XZf kvSbC2lSIKv+3iaJcjhAYPEd3DwQfWcsGmiWg1rJNu19VIbQTsnOYWF910qMAR5ug8 0pLKvGzKn4mneukFMgJyRVP07X8NmxsdjdrGebhY= Date: Tue, 29 Oct 2019 09:06: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: <20191029080634.GB506924@kroah.com> References: <1571211506-19005-1-git-send-email-zhongjiang@huawei.com> <20191025024216.GB331827@kroah.com> <5DB711AE.1040904@huawei.com> <20191028162434.GB321492@kroah.com> <5DB794FB.4010203@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5DB794FB.4010203@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 09:25:15AM +0800, zhong jiang wrote: > On 2019/10/29 0:24, Greg KH wrote: > > 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, > Could you receive the patch ? :-) The patch did not apply properly to my tree, there is no way I can apply it. Please fix it up and resend it so that I can apply it. thanks, greg k-h