Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp172967ybe; Tue, 3 Sep 2019 20:13:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHiPWDSFx8KB+tb/TIRuVLKBRenv0AQoPDCzR7dRaZSiS9IhWBMpuYBrVh4TsjkyNL0dOJ X-Received: by 2002:a17:902:3363:: with SMTP id a90mr38707440plc.270.1567566804047; Tue, 03 Sep 2019 20:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567566804; cv=none; d=google.com; s=arc-20160816; b=VEXSPBUqSWk47OEx+vOBPIavclSw9rUP2NTUj+6nhbsHfCZO2zY/48jPgHUhooly2e CxKbFKHnlacKYtcO9aSYO0jXXpN/xBv//OFR1Y65izVeiTajIK5LiY/qSo3/mfgghbbq 5QiXGLXdxEOW/yqaDuybpNDb55CwXxcxymyPkTotYhraGkgDUNqC3ghEELQjlcbd0jKH O8l3m5x/tWjMdqQAy1HqpMUHrWegNKEhRVtduv/uXVdbF4HhdRifG/uFGBN9DiaSByMH 0MLJloG2FuYG8AMSfwcTSlTn3wq+MxLqIRAIjFTDbCXbJFQ7f9oZY/slGT1gSiBfDhKD 88kg== 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=Kd2/gt5wxXBEfyvKIvjC51czmMdhCCKMWoqHbRLSbrY=; b=uG5VyFeE7eyuI+F/Vs22shEgSIQtodMzx3uyBDXb8x4hZqxtxtnpGushSUNv6VmMRi bftGce2JUF86jjRpOTt6pKxep2M5blzQsEv2yHN060sx0O2kXVOMd8mR+tcxOGhzKbOs 0clQe/H4KzahmkgBUp7TVr5K40gj0TymWdnx2+FC59I5IXjjf6tkjI6F4n+0BDfd4/JV MtQyP5c+G8WFTVqgYSSit+NCvgw6EPf881TXItiENLk0UJWKcO1pVBLZuqTT8GpimVha Obvw6AUqqW/ybFUoW2SS87Oio/ZZWqORbGGkF/bp5AIDPNSpiqxgLCyKC0eBh27SWoRN A7AA== 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 d15si16578816pgv.90.2019.09.03.20.13.07; Tue, 03 Sep 2019 20:13: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; 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 S1727994AbfIDDMV (ORCPT + 99 others); Tue, 3 Sep 2019 23:12:21 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5750 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727709AbfIDDMV (ORCPT ); Tue, 3 Sep 2019 23:12:21 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9368273DDC4D110DB424; Wed, 4 Sep 2019 11:12:18 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 11:12:12 +0800 From: zhong jiang To: , CC: , , Subject: [PATCH] net: hsr: remove an redundant null check before kfree_skb Date: Wed, 4 Sep 2019 11:09:18 +0800 Message-ID: <1567566558-7764-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_skb has taken the null pointer into account. Hence just remove the null check before kfree_skb. Signed-off-by: zhong jiang --- net/hsr/hsr_forward.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index ddd9605..0c9e5b0 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -367,10 +367,8 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port) port->dev->stats.tx_bytes += skb->len; } - if (frame.skb_hsr) - kfree_skb(frame.skb_hsr); - if (frame.skb_std) - kfree_skb(frame.skb_std); + kfree_skb(frame.skb_hsr); + kfree_skb(frame.skb_std); return; out_drop: -- 1.7.12.4