summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-01-17 08:16:52 +1300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-17 08:16:52 +1300
commit62b1530065e9ced536ada063a4d0a748efa43cc8 (patch)
tree325866b16bff040efa2f866a838dce496ebdb4fa /fs
parent7b78de8cb9c095c6d85eefa1bd1b350a3cfe67d0 (diff)
parent72392ed0eb6fde96826cb9d66bd4f50a7ba61450 (diff)
downloadlinux-stable-62b1530065e9ced536ada063a4d0a748efa43cc8.tar.gz
linux-stable-62b1530065e9ced536ada063a4d0a748efa43cc8.tar.bz2
linux-stable-62b1530065e9ced536ada063a4d0a748efa43cc8.zip
Merge tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fix from Greg KH: "Here is one kernfs fix for a reported issue for 3.19-rc5. It has been in linux-next for a while" * tag 'driver-core-3.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: kernfs: Fix kernfs_name_compare
Diffstat (limited to 'fs')
-rw-r--r--fs/kernfs/dir.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 37989f02a226..2d881b381d2b 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -201,10 +201,14 @@ static unsigned int kernfs_name_hash(const char *name, const void *ns)
static int kernfs_name_compare(unsigned int hash, const char *name,
const void *ns, const struct kernfs_node *kn)
{
- if (hash != kn->hash)
- return hash - kn->hash;
- if (ns != kn->ns)
- return ns - kn->ns;
+ if (hash < kn->hash)
+ return -1;
+ if (hash > kn->hash)
+ return 1;
+ if (ns < kn->ns)
+ return -1;
+ if (ns > kn->ns)
+ return 1;
return strcmp(name, kn->name);
}