aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-01-16 14:16:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-16 14:16:52 -0500
commit62b1530065e9ced536ada063a4d0a748efa43cc8 (patch)
tree325866b16bff040efa2f866a838dce496ebdb4fa /fs
parent7b78de8cb9c095c6d85eefa1bd1b350a3cfe67d0 (diff)
parent72392ed0eb6fde96826cb9d66bd4f50a7ba61450 (diff)
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)
201static int kernfs_name_compare(unsigned int hash, const char *name, 201static int kernfs_name_compare(unsigned int hash, const char *name,
202 const void *ns, const struct kernfs_node *kn) 202 const void *ns, const struct kernfs_node *kn)
203{ 203{
204 if (hash != kn->hash) 204 if (hash < kn->hash)
205 return hash - kn->hash; 205 return -1;
206 if (ns != kn->ns) 206 if (hash > kn->hash)
207 return ns - kn->ns; 207 return 1;
208 if (ns < kn->ns)
209 return -1;
210 if (ns > kn->ns)
211 return 1;
208 return strcmp(name, kn->name); 212 return strcmp(name, kn->name);
209} 213}
210 214