Bug 12397 - function stir421x_patch_device can't upload firmware
Summary: function stir421x_patch_device can't upload firmware
Status: CLOSED CODE_FIX
Alias: None
Product: Networking
Classification: Unclassified
Component: Wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Samuel Ortiz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-10 01:16 UTC by Jose-Vicente Gilabert
Modified: 2009-01-25 14:01 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.27
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Jose-Vicente Gilabert 2009-01-10 01:16:23 UTC
The problem is a variable defined as char[11] to keep the name of the firmware file which is always 11 chars long.
It should be a char[12] to fit the trailing "\0".

Patch:
--- irda-usb.c.wrong	2009-01-10 09:50:49.000000000 +0100
+++ irda-usb.c.ok	2009-01-10 09:50:12.000000000 +0100
@@ -1075,7 +1075,7 @@
 {
 	unsigned int i;
 	int ret;
-	char stir421x_fw_name[11];
+	char stir421x_fw_name[12];
 	const struct firmware *fw;
 	const unsigned char *fw_version_ptr; /* pointer to version string */
 	unsigned long fw_version = 0;

The assignment to stir421x_fw_name is made one line later:
        /*
         * Known firmware patch file names for STIR421x dongles
         * are "42101001.sb" or "42101002.sb"
         */
        sprintf(stir421x_fw_name, "4210%4X.sb",
                self->usbdev->descriptor.bcdDevice);
        ret = request_firmware(&fw, stir421x_fw_name, &self->usbdev->dev);

This function has been working through several versions of the kernel but it started to fail after my last ubuntu upgrade.

???

Note You need to log in before you can comment on or make changes to this bug.