From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbbC3RIq (ORCPT ); Mon, 30 Mar 2015 13:08:46 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:33943 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633AbbC3RIp (ORCPT ); Mon, 30 Mar 2015 13:08:45 -0400 Message-ID: <5519831B.8050500@linaro.org> Date: Mon, 30 Mar 2015 12:08:43 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Greg KH , linux-kernel@vger.kernel.org CC: Viresh Kumar Subject: Re: [PATCH] debugfs: allow bad parent pointers to be passed in References: <20150330125915.GA1523@kroah.com> In-Reply-To: <20150330125915.GA1523@kroah.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/30/2015 07:59 AM, Greg KH wrote: > If something went wrong with creating a debugfs file/symlink/directory, > that value could be passed down into debugfs again as a parent dentry. > To make caller code simpler, just error out if this happens, and don't > crash the kernel. > > Reported-by: Alex Elder > Cc: Viresh Kumar > Signed-off-by: Greg Kroah-Hartman Looks good. Reviewed-by: Alex Elder > > --- > fs/debugfs/inode.c | 3 +++ > 1 file changed, 3 insertions(+) > > --- a/fs/debugfs/inode.c > +++ b/fs/debugfs/inode.c > @@ -254,6 +254,9 @@ static struct dentry *start_creating(con > > pr_debug("debugfs: creating file '%s'\n",name); > > + if (IS_ERR(parent)) > + return parent; > + > error = simple_pin_fs(&debug_fs_type, &debugfs_mount, > &debugfs_mount_count); > if (error) >