Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4031811ybg; Fri, 25 Oct 2019 12:20:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3AQJO4/9c7q+gteZHaw2R+cxIXY9aIwAhpfz6U73Qx4ZbHb45tB3q8MhKG8sz7vGyqucK X-Received: by 2002:a50:ce06:: with SMTP id y6mr5777995edi.259.1572031232770; Fri, 25 Oct 2019 12:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572031232; cv=none; d=google.com; s=arc-20160816; b=MbZTBSpsahXBriX8BsATDi/9hRGzyRNZl+GycQSeXpQTLwD3ETDZm/m/gbr/JjxxO4 S23qJdQ5uik5y1qqHN4mXccD0gY3c2403RrqNnV7rtLfTq08GgN989k3LqbRlrpMcD41 B9AKJButceOf3qTXIo+in18xPXzmftRQ2Vmb1rHjyTXM8DvWhUS1dx3NaJbWP1IFuBdI LVUQvit0clAxrcf9uUQg1CjF+2I4+Kk+OCmrmYMkm9PzE376ZgRZ3HhsMe7QxmovczzB ZRgg3Sw6Drgaa8L2ghrWWrPAl+IKKBi2t0Fh46F5NI1/FEum1HI67J0T/mBFRjsEwQV/ gFog== 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=Et1B3K5/zocD9RqVrx1YkIOy3s1CfXFYucrIs7PzwQE=; b=qRJKVg82OqSkBgPOseI7r8DgxKL1XG7p4g/Ahu5qMUlKesMKDH6e+Zwu0WK8lJUaxG MUrsER7mMxjhzz3j+BLE1JjFjtOjL/GZIqAM2GwWL0jaRnJL8DeuMTOrOVHjePZvyWVN Q8SB3vcm2Rp610pRt8orQHwzjn9dCBZFpxudbmpn2Q6ZzNv8nOy2xcCrjSGRiQ1j4GiP ddYBlPKXrN7FuErM6W/Al3+WnR9k54F3fy+s+XlyZ3wURankOsss8SPstwFXHuAY70Qw HEuoA5McYEuHUuiz3Gs1ChUyBke2fLgjBccho2f8rCNRPBnzsOO1lRK9vxY5ZhBp1U6N Smvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NklGzeBx; 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 q18si1975116eda.291.2019.10.25.12.20.09; Fri, 25 Oct 2019 12:20:32 -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=NklGzeBx; 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 S2390859AbfJYCsl (ORCPT + 99 others); Thu, 24 Oct 2019 22:48:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:54520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728416AbfJYCsl (ORCPT ); Thu, 24 Oct 2019 22:48:41 -0400 Received: from localhost (unknown [38.98.37.137]) (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 B5A5621D71; Fri, 25 Oct 2019 02:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571971718; bh=1Ij1pOvkr5r3H3JLSktCJH50P9PNHxYON1Jh5oSWjVI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NklGzeBx2JEUtwUrovi1KXGzUm9YB7RW1oRImgcmP42MJ+vuOKtlZi1mr5voXD0/V KgauZ7anOiIqaCiFO4JV5YxhjLI3RhjA+zAiHyVdH4hzeHWhAEaLdrEw1wH/PZMHSJ qcLqpdbdVS/eu7R2ZQEmPNaszar+L96sAcPZncuw= Date: Thu, 24 Oct 2019 22:42:16 -0400 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: <20191025024216.GB331827@kroah.com> References: <1571211506-19005-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1571211506-19005-1-git-send-email-zhongjiang@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 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 :(