Commit 62b1530065e9ced536ada063a4d0a748efa43cc8

Authored by Linus Torvalds

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

Showing 1 changed file Side-by-side Diff

... ... @@ -201,10 +201,14 @@
201 201 static int kernfs_name_compare(unsigned int hash, const char *name,
202 202 const void *ns, const struct kernfs_node *kn)
203 203 {
204   - if (hash != kn->hash)
205   - return hash - kn->hash;
206   - if (ns != kn->ns)
207   - return ns - kn->ns;
  204 + if (hash < kn->hash)
  205 + return -1;
  206 + if (hash > kn->hash)
  207 + return 1;
  208 + if (ns < kn->ns)
  209 + return -1;
  210 + if (ns > kn->ns)
  211 + return 1;
208 212 return strcmp(name, kn->name);
209 213 }
210 214