[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111213222256.GD2618@moon>
Date: Wed, 14 Dec 2011 02:22:56 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: greg@...ah.com, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/3] DEBUGFS: Automatically create parents for debugfs
files v2
On Tue, Dec 13, 2011 at 01:45:32PM -0800, Andi Kleen wrote:
>
> +/*
> + * Created parents stay around later. Sorry, but it shouldn't be a big issue.
> + */
> +static const char *create_parents(const char *name, struct dentry *parent,
> + struct dentry **pp, int *ref)
> +{
> + char fn[strlen(name) + 1];
> + char *tail;
> + char *s, *p;
> + struct dentry *new_parent, *dentry, *old_parent = NULL;
> +
> + strcpy(fn, name);
> + tail = strrchr(fn, '/');
> + if (!tail)
> + return name;
> + tail++;
> +
Hi Andi, is it possible to do say kstrdup or something instead of
variable-size array in fn[strlen(name) + 1] ? As far as I remember
we already had some warnings with them at least in perf land (or
trace land). Or I miss something?
Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists