Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18398352ybl; Fri, 3 Jan 2020 01:21:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwzni1aChKCd6AOJpLWslydN3jk9UXz78z1utvWFJoVV1iIjwPUJ9GXeNxIf0Xa36g+ekO3 X-Received: by 2002:a9d:6f11:: with SMTP id n17mr82547534otq.126.1578043311395; Fri, 03 Jan 2020 01:21:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578043311; cv=none; d=google.com; s=arc-20160816; b=io1JTQ6mgI6RJvbvern9kUpqHBj5k5PhEpDiJmkzwcbPdSdtMMEllk5weEJWCbxlZ6 5UQBh1CU/DiTQQjg0KzC4np2yn0+BCH+0O1rEholSv4ry/hDPeCv7Sv1IKCPK7k6POPB qivnb7skzBKYPrMTCeH/Ufx6lq1bmL4iHEAQSWIKfGJAPG3ToSBGNjyfb+otm84nJ4Po rwQJEh0MQ992kGMrmQdg/rhaWTx6B6ofN5n3zvzM/8wWnFWnnkNyvYvzyPD74wxmNhqf 9sj37gxbKpgEtCEu+1ciJHwy+wS6kO9pUkuhAWW0aOIt8/ZsUTDaz0F+5ZnuIpWRxCKx Jp4Q== 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=WvfZea5hjCxdaFX0IzcCoNp8+m+UsNUiYOXCtm3P0aA=; b=L0NPKgo95WAGNCPrqQOo+fzqNfGedKO/oXH6MG8TvOFP1P1knLyexZhl+Gs46ca5vU IJLgA2F7bqi9KuUQK+GBMmmXwy/ykB024gD8S6GtVopEQZLYUzhSo3hSk3Bd5TYbonkh C2kJUg2KtkVqkMOLfuRv8kzVIqqn1741asWZhU0ENiqN4RLpmDcnmxarYFqWfL/HnMbJ Ywe8wFmefpZimMfWvzVAso9TG9W81MjKlUaaBfMa/F2/dQhtFAMJuOjy+YrV4Zd+8iI9 KXyKpW9oGNE2wVfNOS5CCEUZx5WpZ8mUoq80zwVh11OSM2cKY/2vLWWEo30zucJssv1r b9VA== 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 i12si32019033otk.215.2020.01.03.01.21.36; Fri, 03 Jan 2020 01:21:51 -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 S1727368AbgACJUy (ORCPT + 99 others); Fri, 3 Jan 2020 04:20:54 -0500 Received: from smtp23.cstnet.cn ([159.226.251.23]:55528 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725972AbgACJUy (ORCPT ); Fri, 3 Jan 2020 04:20:54 -0500 Received: from localhost.localdomain (unknown [159.226.5.100]) by APP-03 (Coremail) with SMTP id rQCowAAXt3BqBw9e7zfDAQ--.37S3; Fri, 03 Jan 2020 17:20:43 +0800 (CST) From: Xu Wang To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: Remove redundant BUG_ON() check in phonet_pernet Date: Fri, 3 Jan 2020 09:20:40 +0000 Message-Id: <1578043240-35541-1-git-send-email-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: rQCowAAXt3BqBw9e7zfDAQ--.37S3 X-Coremail-Antispam: 1UD129KBjvdXoW7Gr45Ww43XF18tw15XrW7twb_yoWxAFcEyF 4xu3Wjvw10gr1j9r4Yqw45ArZxXa4vqF1xGr1DKFZ7Aa98Krn8Z3ykur18GFW7Wrs0kr1f A3W7Ary5uwnxujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbFxYjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z2 80aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAK zVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx 8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s02 6xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVWUXVWUAwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v2 6r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj4 0_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j 6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jY6wZUUUUU= X-Originating-IP: [159.226.5.100] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiBAMEA102S2KgFwAAs1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Passing NULL to phonet_pernet causes a crash via BUG_ON. Dereferencing net in net_generic() also has the same effect. This patch removes the redundant BUG_ON check on the same parameter. Signed-off-by: Xu Wang --- net/phonet/pn_dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index 49bd76a..ac0fae0 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -35,8 +35,6 @@ static unsigned int phonet_net_id __read_mostly; static struct phonet_net *phonet_pernet(struct net *net) { - BUG_ON(!net); - return net_generic(net, phonet_net_id); } -- 2.7.4