Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7437353ybl; Tue, 24 Dec 2019 02:33:36 -0800 (PST) X-Google-Smtp-Source: APXvYqy7m+kwSYnN7JVIW3sVBf7oj0CgqvyX6yERoCKmSiPaFLB5Mxow8kcuiMvxH0sov4sze4fc X-Received: by 2002:a05:6830:2116:: with SMTP id i22mr39665197otc.0.1577183614172; Tue, 24 Dec 2019 02:33:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577183614; cv=none; d=google.com; s=arc-20160816; b=jtoeGDI9WhVbp6OeYOm1yvM22CifQl4qvzQsi7XT82J5O9J83YEwpjsKOTqyqLHBwH Ez8TIEVaiVJsNYKXqkWpvaGNg02sTi45DAp36IxOyNNqOZ2y1W3w8vh2kGfbR9uFK+Pc Uk4WMzxFQYI36cINRnBA2MjKXdd5o0PKdPEuanwzyDGdznSlUCWHI8jOu8JfwdfNqO8M yskvDz0xpIK6FqeooIHQgPhtVCeXnyhRkDGQNcVdyT7+8nIX4LJj+zyKZV04UggnbgN+ LIbu7CdHXpGKvLJxNeJOUsIyktpzpDX+37V7D9h1FzFf+jLBPv/rV3mG6hkj2U6a6Nyf 7/QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=1eR8/lQqnMjx8Q7ozV/uYOXz54qfxMXQmslTuXEaAxk=; b=myEd2AkqEGTE0ftIofIuMTrYfUfcjLaAE5d3mGVhzxMvK4IvjeGsmRfVxJxZEBJpSU OJcxCNVOrEXrn8OZawaDzBvdY0/WKHynRchnJ4j7irIorBUfpVqQh+rrRU9QxLsFGAsL tFCPgZmak1Kh/hyCxExDfCxvmUiW3dsl7PEDYacE/z6zJvLvz5tGpTSCi8ZATdKB0LHt k+e7r9mwKjZJ+rrTzC+rhpDv1mojerxZ9kof8jcqtXl4amKKmNxcbsSSXbseF3nGXH51 Ucsfz5nXTo6mnJ60/NrKZqSDy+ZszUFTvpsvmHWKvItqCAcW7SBrdOO2jrrspP7k2+0Y dtrA== 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 c21si11625574otr.223.2019.12.24.02.33.23; Tue, 24 Dec 2019 02:33:34 -0800 (PST) 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 S1726225AbfLXKcr (ORCPT + 99 others); Tue, 24 Dec 2019 05:32:47 -0500 Received: from smtp25.cstnet.cn ([159.226.251.25]:50680 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726076AbfLXKcr (ORCPT ); Tue, 24 Dec 2019 05:32:47 -0500 Received: from localhost.localdomain (unknown [159.226.5.100]) by APP-05 (Coremail) with SMTP id zQCowAAXHc1D3AFeEjTIBQ--.98S3; Tue, 24 Dec 2019 17:37:08 +0800 (CST) From: Xu Wang To: paulus@samba.org Cc: davem@davemloft.net, linux-ppp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ppp: Remove redundant BUG_ON() check in ppp_pernet Date: Tue, 24 Dec 2019 09:37:04 +0000 Message-Id: <1577180224-16405-1-git-send-email-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: zQCowAAXHc1D3AFeEjTIBQ--.98S3 X-Coremail-Antispam: 1UD129KBjvdXoWrtFW8Jr4UKFyrurWxAw4DXFb_yoW3Jrb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List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Passing NULL to ppp_pernet causes a crash via BUG_ON. Dereferencing net in net_generici() also has the same effect. This patch removes the redundant BUG_ON check on the same parameter. Signed-off-by: Xu Wang --- drivers/net/ppp/ppp_generic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 3bf8a8b..22cc2cb 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c @@ -296,8 +296,6 @@ static struct class *ppp_class; /* per net-namespace data */ static inline struct ppp_net *ppp_pernet(struct net *net) { - BUG_ON(!net); - return net_generic(net, ppp_net_id); } -- 2.7.4