Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2530358imu; Sun, 23 Dec 2018 01:45:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN4A2ht6EB2FnMe6cyd6EAeAyKt6IeCM4KWjkgJsG2DOkmw9npuctL8NCt/vI1Ot9vjaWAee X-Received: by 2002:a17:902:6e0f:: with SMTP id u15mr8977023plk.175.1545558311416; Sun, 23 Dec 2018 01:45:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545558311; cv=none; d=google.com; s=arc-20160816; b=ILcVjvLgtGZzHt7rGt5tW1qwnurToY8d0py7Xea31KagqodgGDhxvDi/R0a+1VECU6 Krlnvs44YelyciuVQyh8kQHvf+X6D55abBTX8wMneM2HuB/rPi38Xq4cy0LpKE9LXW/C DFg1VHjjSMSJjgsKqp3KHUtqS4PErPwTZWoBjRgmSVDLRJCa5FtpbcyGxqiUmSn+2VHW u8wFnBNL9dIdkAcABOZS5TwGI0ffUvG4vWoBeEMxu9BLMhWGtP/dRfhUyf14+WS0prVx bFoHI7T2QIALO4A+NlC7Q5xhTf5bWiI7HRZ9D6B1eNIBZNDfA5tmevDLa1dl0EpVgGBH bmWg== 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 :dkim-signature; bh=DpBXnTrI3d3LSp9uVlQfU7VTXWrDm9hWpNXZOCmAIV4=; b=LjKzFXboJgFKi4bU3W9e8oc1EIfsHoqWcWtKNqpWnDFYrAjZ95Kjt9ywAUP6frsxx0 ben1dDoz2LkDkqdp7N2NQo9/q4BYVSz7gd1Ac7b3hYyyIIDDyhRAydM1zdyaUDuHoI2m x+UjLnCiggEWhffLvhN20+/OWkTbT7EhR0U6F8YqZqwozDwXIbGIXOo9hpyC0bsbuQwK AeCn49ZAgpeHdxwnwjWitddtn9EZ1DNARVNE0KeeJi943hNbht9FFp38KK1ipJ6Vu7l7 T1ipp24oRpQjGrcRWOaQq/xK92TnmToocOYzOchVfHkT1Pg494bspU0PO4qPqv4+2v6X GEHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XDQz/dDA"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 43si24836763plb.176.2018.12.23.01.44.56; Sun, 23 Dec 2018 01:45:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XDQz/dDA"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728858AbeLVCMp (ORCPT + 99 others); Fri, 21 Dec 2018 21:12:45 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38090 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbeLVCMp (ORCPT ); Fri, 21 Dec 2018 21:12:45 -0500 Received: by mail-pl1-f195.google.com with SMTP id e5so3268586plb.5; Fri, 21 Dec 2018 18:12:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=DpBXnTrI3d3LSp9uVlQfU7VTXWrDm9hWpNXZOCmAIV4=; b=XDQz/dDAou1ZwGcANy2a0ttg8Lym0TQc8Rz4TlghW30bOwvkLzIxqQ0/gr4GgCHalR tjeICMQnd+TDgd41hwbYlZzwsvsBLoYgIvbWoPMsSwHHE281PcPCVsbemFMeLVGXOCya +/47lc0a4fH3JztoqNnyYReVqrpY1Xe16fGG8ywpPBjuEaj+x1HVo0bZRkIG6LqVe9rD Rrf4WhnE3viDBjL9I0aeX3qMZj5jv8dGJBp2RloMeTuW5VZJf0Qi+Ulryh3P7vdd3fNI AoM8A1Ibae6E2bnNclW2kWDJSLWzzXmbuLwzKTv6qk0db4tz9eYdJ3kfWET1SyJ/KBv7 M4NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DpBXnTrI3d3LSp9uVlQfU7VTXWrDm9hWpNXZOCmAIV4=; b=c4TA5ae2icr67Bdefcd8SUO8ST8SJCBEF0OAhGbF2UuJdx8edgJGJHU0NaEGjD1q7a 1DSZvZMVYEyQS12/IkLApiKDO9LrpWpFxNN0vg4hw/76svYDtXNTJUUQmg8VdWUCmQMD AdF4zAsx9c3/p7coKDDNfDgZOeZidUgKLhLAtYzsIqIWxQwPnGZ1YS9L4C4MVQtjnjBp mMk8NhkUIeGruG8YrLsRXxkWHWFoAMH74hdAgQ5IDV01lu2l/Twz9GaKSknFd4Mjz9iy pJsdMlyDizk/4HoMJX5ACNZu2v0liZOBtA7zc0c230j8ErbiL8fa15xHW/nztDd+FeKV DVdA== X-Gm-Message-State: AJcUuke0C3e4GKfh0rAvy8qyXv8zo6G5o2Yyl3os1BdPeDW/Or52z/kk xquoYjO8V4w1i5TGtT6PEPY= X-Received: by 2002:a17:902:7296:: with SMTP id d22mr4955123pll.265.1545444764949; Fri, 21 Dec 2018 18:12:44 -0800 (PST) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id i62sm27587666pge.44.2018.12.21.18.12.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 18:12:44 -0800 (PST) From: Yafang Shao To: mcgrof@kernel.org, keescook@chromium.org, adobriyan@gmail.com, akpm@linux-foundation.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH] proc: sysctl: fix double drop_sysctl_table() Date: Sat, 22 Dec 2018 10:12:21 +0800 Message-Id: <1545444741-31694-1-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The callers of insert_header() will drop sysctl table whatever insert_header() successes or fails. So we can't call drop_sysctl_table() in insert_header(). The call sites of insert_header() are all in fs/proc/proc_sysctl.c. Signed-off-by: Yafang Shao --- fs/proc/proc_sysctl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 4d598a3..5eddca4 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -241,7 +241,6 @@ static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header) if (header->ctl_table == sysctl_mount_point) clear_empty_dir(dir); header->parent = NULL; - drop_sysctl_table(&dir->header); return err; } -- 1.8.3.1