Skip to contentSkip to conversation

usb-6fire: Modify firmware version check

PATCH Applied Torsten Schenk 2 participants 2 messages May 23, 2013 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-6fire: Modify firmware version check

Check only the uppermost 16 bits instead of the whole 32 bits of the version information. Do this because all firmware version tested with this version information worked correctly and the strict check causes problems for several users.

sound/usb/6fire/firmware.c +3 -3
diff -Nur a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c
@@ -42,8 +42,8 @@
 	0x94, 0x01, 0x5c, 0x02  /* alt 3: 404 EP2 and 604 EP6 (25 fpp) */
 };
 
-static const u8 known_fw_versions[][4] = {
-	{ 0x03, 0x01, 0x0b, 0x00 }
+static const u8 known_fw_versions[][2] = {
+	{ 0x03, 0x01 }
 };
 
 struct ihex_record {
@@ -343,7 +343,7 @@
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(known_fw_versions); i++)
-		if (!memcmp(version, known_fw_versions + i, 4))
+		if (!memcmp(version, known_fw_versions + i, 2))
 			return 0;
 
 	snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %*ph. "
Applied
#1 lore raw

At Thu, 23 May 2013 13:38:29 +0200,

Quoted 7 lines · Torsten Schenk

Check only the uppermost 16 bits instead of the whole 32 bits of the version information. Do this because all firmware version tested with this version information worked correctly and the strict check causes problems for several users.

Thanks, applied.

Takashi

Quoted 24 lines

diff -Nur a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c

sound/usb/6fire/firmware.c +3 -3
@@ -42,8 +42,8 @@
 	0x94, 0x01, 0x5c, 0x02  /* alt 3: 404 EP2 and 604 EP6 (25 fpp) */
 };
 
-static const u8 known_fw_versions[][4] = {
-	{ 0x03, 0x01, 0x0b, 0x00 }
+static const u8 known_fw_versions[][2] = {
+	{ 0x03, 0x01 }
 };
 
 struct ihex_record {
@@ -343,7 +343,7 @@
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(known_fw_versions); i++)
-		if (!memcmp(version, known_fw_versions + i, 4))
+		if (!memcmp(version, known_fw_versions + i, 2))
 			return 0;
 
 	snd_printk(KERN_ERR PREFIX "invalid fimware version in device: %*ph. "