Commit bc9dc9d5 authored by Bjørn Mork's avatar Bjørn Mork Committed by Linus Torvalds

lib/uuid.c: use correct offset in uuid parser

Use '+ 0' and '+ 1' as offsets, like they were intended, instead of
adding to the result.

Fixes: 2b1b0d66 ("lib/uuid.c: introduce a few more generic helpers")
Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cfaff0e5
...@@ -106,8 +106,8 @@ static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8 ei[16]) ...@@ -106,8 +106,8 @@ static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8 ei[16])
return -EINVAL; return -EINVAL;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
int hi = hex_to_bin(uuid[si[i]] + 0); int hi = hex_to_bin(uuid[si[i] + 0]);
int lo = hex_to_bin(uuid[si[i]] + 1); int lo = hex_to_bin(uuid[si[i] + 1]);
b[ei[i]] = (hi << 4) | lo; b[ei[i]] = (hi << 4) | lo;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment