Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7209280ybp; Wed, 16 Oct 2019 05:31:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyu9WudwUeft7/2t/Org/6ZvZgqtJ3fs+5228GZxwesbIw5o+j9hFyYw7qQtll7XpxrIFQF X-Received: by 2002:a17:906:4548:: with SMTP id s8mr40232764ejq.198.1571229095785; Wed, 16 Oct 2019 05:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571229095; cv=none; d=google.com; s=arc-20160816; b=AVrAelRWg9uOdzfD51GNfyGp5lJMfizVVo4b1WomTKDyPk8LY7T67k4cCxk6KFcbKm i+06amYtpfSNC4b+3049ET8OhAxvrZ2hoyCV1Z0OYKR4UzQ1nwTNNc8KMYpXIXYD+2z4 XPBz88GbZ+qg4roxqifAejDcUToyDyZf5m2UbLsSzY8CpjNaFP5mX8q1iPRtKsX41PlG voMSCITalB73oTFrdQ3V8O6LAXsi0n7lDm9hRJeoR68nTRkAkl9SLe0LDSeBPlnMgUmp +kjc8CjIo5qeEiQePwS3iPFw3ljpmpOTqxArES67Rm6YqYqt91Nnt8UWDN1d5fmU3/ZU pPfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=w03MTdOw7682g5EABpBAqWokmHwNyPeOzMCHEmN6Pes=; b=xQmqQ+UzxS6iFx7hLjTvpAkCmvkLr89eCibWtSfTEjWdYxP+0WXtlmKYHw5oR5JxEB M+0Zv3OeHopIdNWYhc1b9qr+b41OTuscmkwL57Tcdsu+MX3R1sCu6ryknkHd6kc9bipP 3YXKWjh2MXaOpN+MmJOOnn5z346VROsPsQxoZCV19KaZcocYR7wTUfqYHnzzXaRBOVKv D7C84bJCMMCSnFuDTCqh2bTVvOmDT28FEyU8puTHijdEIDAyxFiiByKg9pHDD72/OhTe SjySrKj8aE0YHhaH04h0EzD4nMeIcR9Wmh3wFNbbTUd2q7HOeixQAogtRTqclkLitiUk zOPA== ARC-Authentication-Results: i=1; mx.google.com; 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 a36si17555749edf.123.2019.10.16.05.31.12; Wed, 16 Oct 2019 05:31:35 -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; 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 S2391179AbfJPHmZ (ORCPT + 99 others); Wed, 16 Oct 2019 03:42:25 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3778 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728201AbfJPHmZ (ORCPT ); Wed, 16 Oct 2019 03:42:25 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 69F6FD40EE297C4244F5; Wed, 16 Oct 2019 15:42:22 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Wed, 16 Oct 2019 15:42:14 +0800 From: zhong jiang To: CC: , Subject: [PATCH] staging: rtl8723bs: remove an redundant null check before kfree() Date: Wed, 16 Oct 2019 15:38:26 +0800 Message-ID: <1571211506-19005-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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