From: Bjørn Mork Date: Mon, 30 May 2016 14:40:42 +0000 (+0300) Subject: lib/uuid.c: use correct offset in uuid parser X-Git-Tag: Ubuntu-5.0.0-8.9~7082^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=bc9dc9d5eec908806f1b15c9ec2253d44dcf7835;p=mirror_ubuntu-disco-kernel.git 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 Signed-off-by: Andy Shevchenko Signed-off-by: Linus Torvalds --- 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]) return -EINVAL; for (i = 0; i < 16; i++) { - int hi = hex_to_bin(uuid[si[i]] + 0); - int lo = hex_to_bin(uuid[si[i]] + 1); + int hi = hex_to_bin(uuid[si[i] + 0]); + int lo = hex_to_bin(uuid[si[i] + 1]); b[ei[i]] = (hi << 4) | lo; }