summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-05-18 20:26:39 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-18 20:26:39 -0700
commita209bc783232c668923f2677451fedab74a0e367 (patch)
treeb6c61c621a53564234e611549928752ba693d34b /fs
parentd847507434bbeda3e22b5f2c1cd5c486905ec1ab (diff)
[PATCH] sysfs_create_link() fix
It is incorrectly precalculating the string's length.
Diffstat (limited to 'fs')
-rw-r--r--fs/sysfs/symlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 5a2bd9c90a38..8ec65b81bdce 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -80,7 +80,7 @@ int sysfs_create_link(struct kobject * kobj, struct kobject * target, char * nam
char * s;
depth = object_depth(kobj);
- size = object_path_length(target) + depth * 3 - 1;
+ size = object_path_length(target) + depth * 3 + 1;
if (size > PATH_MAX)
return -ENAMETOOLONG;
pr_debug("%s: depth = %d, size = %d\n",__FUNCTION__,depth,size);