diff options
author | Bjørn Mork <bjorn@mork.no> | 2016-05-30 10:40:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-30 18:26:57 -0400 |
commit | bc9dc9d5eec908806f1b15c9ec2253d44dcf7835 (patch) | |
tree | 4ab99d51ed39952bbd7500dca2abd2b7831184a5 /lib | |
parent | cfaff0e515b544fa0a9cdc58a975cc629ff3bc17 (diff) |
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: 2b1b0d66704a ("lib/uuid.c: introduce a few more generic helpers")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/uuid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/uuid.c b/lib/uuid.c index e116ae5fa00f..37687af77ff8 100644 --- a/lib/uuid.c +++ b/lib/uuid.c | |||
@@ -106,8 +106,8 @@ static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8 ei[16]) | |||
106 | return -EINVAL; | 106 | return -EINVAL; |
107 | 107 | ||
108 | for (i = 0; i < 16; i++) { | 108 | for (i = 0; i < 16; i++) { |
109 | int hi = hex_to_bin(uuid[si[i]] + 0); | 109 | int hi = hex_to_bin(uuid[si[i] + 0]); |
110 | int lo = hex_to_bin(uuid[si[i]] + 1); | 110 | int lo = hex_to_bin(uuid[si[i] + 1]); |
111 | 111 | ||
112 | b[ei[i]] = (hi << 4) | lo; | 112 | b[ei[i]] = (hi << 4) | lo; |
113 | } | 113 | } |