From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932937AbcE3Kw0 (ORCPT ); Mon, 30 May 2016 06:52:26 -0400 Received: from canardo.mork.no ([148.122.252.1]:48859 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932192AbcE3KwZ (ORCPT ); Mon, 30 May 2016 06:52:25 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Andy Shevchenko Cc: Linus Torvalds , Kui Zhang , Darren Hart , Andrew Morton , Linux Kernel Mailing List Subject: Re: WMI driver no longer load after switching to generic UUID library Organization: m References: <1464595081.27624.48.camel@linux.intel.com> Date: Mon, 30 May 2016 12:52:14 +0200 In-Reply-To: <1464595081.27624.48.camel@linux.intel.com> (Andy Shevchenko's message of "Mon, 30 May 2016 10:58:01 +0300") Message-ID: <87y46ru8bl.fsf@nemi.mork.no> User-Agent: Gnus/5.130015 (Ma Gnus v0.15) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable How about the untested attached patch? Bj=C3=B8rn --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-lib-uuid.c-use-correct-offset-in-uuid-parser.patch Content-Transfer-Encoding: quoted-printable >>From d1682d6c0a558cf8ffb82af959156f99f0f1f61a Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Bj=3DC3=3DB8rn=3D20Mork?=3D Date: Mon, 30 May 2016 12:44:05 +0200 Subject: [PATCH] lib/uuid.c: use correct offset in uuid parser MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit 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=C3=B8rn Mork --- lib/uuid.c | 4 ++-- 1 file 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]) return -EINVAL; =20 for (i =3D 0; i < 16; i++) { - int hi =3D hex_to_bin(uuid[si[i]] + 0); - int lo =3D hex_to_bin(uuid[si[i]] + 1); + int hi =3D hex_to_bin(uuid[si[i] + 0]); + int lo =3D hex_to_bin(uuid[si[i] + 1]); =20 b[ei[i]] =3D (hi << 4) | lo; } --=20 2.1.4 --=-=-=--