Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2543723rwb; Sun, 4 Sep 2022 19:01:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR56YqgkNN/z9pg6D8OF8i1pKZCKDS6ZwEFgRESu1cHweCgig2Sv9/mkx8g94sGxv520zS8P X-Received: by 2002:a63:798c:0:b0:42a:4612:c07b with SMTP id u134-20020a63798c000000b0042a4612c07bmr39959387pgc.519.1662343293705; Sun, 04 Sep 2022 19:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662343293; cv=none; d=google.com; s=arc-20160816; b=zUfAFNPOH88rp4Id5n3ez6aorlEJLvS7ySuLZu2AG4D5uWzCwKuJektqSng3UX3oTY PLlw4exWJ+m2XXNOPiEFvBtKjYUMZlS86aH2I7SXb/+Lhw5UefNe3h0kkxs29TWtoCvW 2caUJWXvW7imrC/K/feOPAN6ZcwS2KeueTQ9elURYWd/uxgcaqT9NtRoRBwinYdSxTLt dQy8JBp8FzQ0oLAmBfG1b5NPiap4km7pT6SEJ61Pxxdb9M4AqfC4bZ8mkCcOjEX/S+0e N3LsPVBaN1aCkkP5w2FaF7B+MLWyOmbhYop+5RUGaDf2bl7luc8VjJSouiCe34VHGdHJ a0dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=LBqFMCEJSVDlg9nW51NLLKtkDJzJfS/ZMoWzwzNGX/M=; b=U/TNJ5TtDP8inOlPILHUuFDQqfAt0MY7MV9oZuB3lGSVWCA+7oTVRAnch/oXcQPBxt G6IWXShxe2i46HVLsKjc0bVtK1mYbjNlIoS3Mpxh6RRoG4DU8HX8MF+IRes196jb8xLs tJVFj2ES06DavMq4FJ3Ic2FAhG6fgbAyl0ackIVneZD0YszV/E9Mkm3BrzWBKR4v4GVf BEpIzjHxv8Ek1sPv3eFOd0vRjKNtUDhYssMl3uYnq40SU9B4JJVhlbB+9g6xmkddcCIR opNsx1jtDKv32KwzhbYoa2f8iVHvEN6Xftablwfo7Y2MgFavb9/K38CLLpbrlmOPMHea VTNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a056a00159000b005363a647bd5si9438288pfk.201.2022.09.04.19.01.22; Sun, 04 Sep 2022 19:01:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235233AbiIEB3i (ORCPT + 99 others); Sun, 4 Sep 2022 21:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbiIEB3f (ORCPT ); Sun, 4 Sep 2022 21:29:35 -0400 Received: from mail.nfschina.com (unknown [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 954D02721; Sun, 4 Sep 2022 18:29:30 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 0DBB31E80D74; Mon, 5 Sep 2022 09:28:37 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RecJVu1hqtca; Mon, 5 Sep 2022 09:28:34 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 65B7E1E80D59; Mon, 5 Sep 2022 09:28:34 +0800 (CST) From: Li zeming To: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Li zeming Subject: [PATCH] proc/proc_sysctl: Modify the order of scheduling function calls Date: Mon, 5 Sep 2022 09:29:25 +0800 Message-Id: <20220905012925.3117-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,MAY_BE_FORGED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the ctl_table_header object is judged to be valid, the scheduling check is performed again. Signed-off-by: Li zeming --- fs/proc/proc_sysctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 50ba9e4fb284..36921e2ebeb0 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1729,11 +1729,10 @@ static void drop_sysctl_table(struct ctl_table_header *header) void unregister_sysctl_table(struct ctl_table_header * header) { int nr_subheaders; - might_sleep(); - if (header == NULL) return; + might_sleep(); nr_subheaders = count_subheaders(header->ctl_table_arg); if (unlikely(nr_subheaders > 1)) { struct ctl_table_header **subheaders; -- 2.18.2