Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5da4e689 authored by Al Viro's avatar Al Viro
Browse files

devtmpfs: get rid of bogus mkdir in create_path()



We do _NOT_ want to mkdir the path itself - we are preparing to
mknod it, after all.  Normally it'll fail with -ENOENT and
just do nothing, but if somebody has created the parent in
the meanwhile, we'll get buggered...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 69753a0f
Loading
Loading
Loading
Loading
+18 −24
Original line number Diff line number Diff line
@@ -164,19 +164,15 @@ static int dev_mkdir(const char *name, mode_t mode)

static int create_path(const char *nodepath)
{
	int err;

	err = dev_mkdir(nodepath, 0755);
	if (err == -ENOENT) {
	char *path;
	char *s;
	int err;

	/* parent directories do not exist, create them */
	path = kstrdup(nodepath, GFP_KERNEL);
		if (!path) {
			err = -ENOMEM;
			goto out;
		}
	if (!path)
		return -ENOMEM;

	s = path;
	for (;;) {
		s = strchr(s, '/');
@@ -190,8 +186,6 @@ static int create_path(const char *nodepath)
		s++;
	}
	kfree(path);
	}
out:
	return err;
}