Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1783364imm; Thu, 20 Sep 2018 02:51:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaKTnttZSId37RmRbgua2rDCfFj9QBXtUisBFKUAGBvMRu7eWC1tyQBJZqzsoQkmjkMooli X-Received: by 2002:a63:41c2:: with SMTP id o185-v6mr5267593pga.11.1537437060780; Thu, 20 Sep 2018 02:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537437060; cv=none; d=google.com; s=arc-20160816; b=iEb6LyhG66+LhdPVqbrh+1VpFm2gcucZEwtOMfCyGhQT9qkiwwSdKc9lUlXWCX3Gmq 4jZSKmZHYc0UuN2406NjmyV820qqNZcp2ML4kf8KjE9PdhRXGW4gW4LIU0HozeVoFay+ p7AQgBUb3NZ5BAfqvTEbZf0TDH0XI/xaN6ccr62FmoQqrYVS5rr3qnuD5JZHwjsh8mJC ByQTb3GSrDO5TXMoCOwCbGEZURDAI3fz6UASIQCo+gBvOQkjVKOBVUSZwri22jfQ0i6a rCbR024evLrjisqz5s04MiJyV4liDch4KdNWP9DdN2VJrE/6u9poCilNnGQ57+XSqGdu wMtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=BDJLAI2mYLBhBsrI5/6aPotvdx2LvIKucZSpUNv/xDw=; b=mkby3nUeGKxn3zppCBW7BUPIDpCSUfhSUFHGjsnKKZp+V0osr8eq+733veyNWerl9Z uFa8+KMb4SzSCaHiBEjYG7a5/EZf2nd8rmPoFt/wFwGp5bqeLEuk8c/kBeZxbf44pVZP /PHDpFCqiVdQ+m5/QHcemGGeI3T4cIMlZprwTrP3M5/3/FnHcCX50Pe5nYMLDGmdmcUt QSXSA6uklrsRIDj/SyqG/hK7jqdZD+PwPw7uhEDiwlvBofa5kRfWUYsVqBExDeIcU+MX 5BYa3u0AI4KCPBzEsuhaL3mfXcOl5VJp2crm1tn2eLzxoejPneIaMMs8Bgj8Rpr5hfpC GkyQ== 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 h9-v6si27512424plk.461.2018.09.20.02.50.45; Thu, 20 Sep 2018 02:51: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; 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 S2387535AbeITPcz (ORCPT + 99 others); Thu, 20 Sep 2018 11:32:55 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12635 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732047AbeITPcy (ORCPT ); Thu, 20 Sep 2018 11:32:54 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B8D472D7BF9AD; Thu, 20 Sep 2018 17:50:12 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Thu, 20 Sep 2018 17:50:10 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH 3/6] ipv4: remove redundant null pointer check before kfree_skb Date: Thu, 20 Sep 2018 17:37:43 +0800 Message-ID: <1537436266-41955-4-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> References: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> 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 it is safe to remove the redundant null pointer check before kfree_skb. Signed-off-by: zhong jiang --- net/ipv4/ip_fragment.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index da930b0..13f4d18 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -260,8 +260,7 @@ static void ip_expire(struct timer_list *t) spin_unlock(&qp->q.lock); out_rcu_unlock: rcu_read_unlock(); - if (head) - kfree_skb(head); + kfree_skb(head); ipq_put(qp); } -- 1.7.12.4