lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100425213140.371194b0@neptune.home>
Date:	Sun, 25 Apr 2010 21:31:40 +0200
From:	Bruno Prémont <bonbons@...ux-vserver.org>
To:	Jiri Kosina <jkosina@...e.cz>
Cc:	linux-kernel@...r.kernel.org, linux-input@...r.kernel.org
Subject: [PATCH] hid: fix picolcd's version parsing

During grouping of version checking code bootloader mode's version
bytes got swapped. Fix their order.

Signed-off-by: Bruno Prémont <bonbons@...ux-vserver.org>
---
 drivers/hid/hid-picolcd.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index 0fbc7d3..6f71c60 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -1196,16 +1196,14 @@ static int picolcd_check_version(struct hid_device *hdev)
 	}
 
 	if (verinfo->raw_size == 2) {
+		data->version[0] = verinfo->raw_data[1];
+		data->version[1] = verinfo->raw_data[0];
 		if (data->status & PICOLCD_BOOTLOADER) {
 			dev_info(&hdev->dev, "PicoLCD, bootloader version %d.%d\n",
-					verinfo->raw_data[0], verinfo->raw_data[1]);
-			data->version[0] = verinfo->raw_data[0];
-			data->version[1] = verinfo->raw_data[1];
+					verinfo->raw_data[1], verinfo->raw_data[0]);
 		} else {
 			dev_info(&hdev->dev, "PicoLCD, firmware version %d.%d\n",
 					verinfo->raw_data[1], verinfo->raw_data[0]);
-			data->version[0] = verinfo->raw_data[1];
-			data->version[1] = verinfo->raw_data[0];
 		}
 	} else {
 		dev_err(&hdev->dev, "confused, got unexpected version response from PicoLCD\n");
-- 
1.6.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ