Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ED03C10F11 for ; Tue, 23 Apr 2019 01:35:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F81D20859 for ; Tue, 23 Apr 2019 01:35:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sxdXcnlR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729430AbfDWBfN (ORCPT ); Mon, 22 Apr 2019 21:35:13 -0400 Received: from mail-qk1-f202.google.com ([209.85.222.202]:49519 "EHLO mail-qk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727840AbfDWBfM (ORCPT ); Mon, 22 Apr 2019 21:35:12 -0400 Received: by mail-qk1-f202.google.com with SMTP id o64so166523qka.16 for ; Mon, 22 Apr 2019 18:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=FRHRLhhoEPDKucvygooUtVlRBH4J61MyDpwQngu/wTs=; b=sxdXcnlRHAhrAj3HetZ4WwUbngrCg1NzNMqVt/rZ8hkHFJpcGR78Hm4u0sJyCFn5sH 9Ocm3NbEmyPd24DCuJneQsbyPMsofvNwbLtKHw0Slzr/0QW2kPql3B93Q/EsM3zlfMuc WR7uSDTrPMxyUs16+C7R9cWLRZEX9npkmK75vPSdNS9iOjXHFlO6b3YP4yGRrxNd4q6O S5OIq+17pu7EsfpHtHXVzgFvapqxKdFxDVnkz5Kk9ak8Z3vbH1LsfmXlyHuOLAf3tO4D GTB82CjuXkrtJexOoEmFbt1TN0mIptYhuw3oiBoF/JL7f0FPUd24hh5UGt34TkL74vAt GL6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=FRHRLhhoEPDKucvygooUtVlRBH4J61MyDpwQngu/wTs=; b=t83k9n24Fe0vcCfzhl2RfDBKs7t3S55S4qJYRfdRUoobDP76djxC3gTE2Ic03mC2Sm TSlGEtkUjofUFiF0hwu7RkzvQmh67hun0aTMm2XLW0fanT6rSZ2J0G1w7vjme6qBwTyv yOtsV8DQk+WlqFNWI6EUfBUtejlj6HrIo1n9GN9eyN70OWtR1NIvywGeZ2yzIjoubuac QW8RPlfj7u/WMoYXc+zBT3DLxMq0s9GUiH8SuOwVEeTc3paWq+fMaESgOyQ1IILLQxeH qAFq5yvtaATxTRi9Hu33h5JBsFyh+HEg+p5q6yaZVtjpHpKeCyFgO6I6WHxYsgFo/CnI gQpQ== X-Gm-Message-State: APjAAAWRNkoWy+wnZpo7dhmoG2GQDV405yaGJthatXaBcFaKGzwbBrc/ GUKCmutIA6s+QfXFb47su1BahlkwlQf1Lg== X-Google-Smtp-Source: APXvYqzTveMFoxRg90PuWqANh9Fq/IhOlLUA2kGRINwv5/55smBESRGIfqKGKQMbFAIZhCX3uaMF+pXRPMKMug== X-Received: by 2002:a05:620a:148d:: with SMTP id w13mr17276610qkj.6.1555983311934; Mon, 22 Apr 2019 18:35:11 -0700 (PDT) Date: Mon, 22 Apr 2019 18:35:01 -0700 In-Reply-To: <20190423013503.217729-1-edumazet@google.com> Message-Id: <20190423013503.217729-2-edumazet@google.com> Mime-Version: 1.0 References: <20190423013503.217729-1-edumazet@google.com> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog Subject: [PATCH net-next 1/3] ipv6: fib6_info_destroy_rcu() cleanup From: Eric Dumazet To: "David S . Miller" Cc: netdev , Eric Dumazet , Eric Dumazet , Wei Wang Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We do not need to clear f6i->rt6i_exception_bucket right before freeing f6i. Note that f6i->rt6i_exception_bucket is properly protected by f6i->exception_bucket_flushed being set to one in rt6_flush_exceptions() under the protection of rt6_exception_lock. Signed-off-by: Eric Dumazet Cc: Wei Wang --- net/ipv6/ip6_fib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index b47e15df9769ccb2919e6ec0de5edd93f2ae518f..55193859152969794dab3df02637217a7f21016f 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -175,10 +175,7 @@ void fib6_info_destroy_rcu(struct rcu_head *head) WARN_ON(f6i->fib6_node); bucket = rcu_dereference_protected(f6i->rt6i_exception_bucket, 1); - if (bucket) { - f6i->rt6i_exception_bucket = NULL; - kfree(bucket); - } + kfree(bucket); if (f6i->rt6i_pcpu) { int cpu; -- 2.21.0.593.g511ec345e18-goog