On Sun, 2009-03-01 at 20:29 -0800, David Miller wrote:
I cared enough to fix this, maybe one of you will care enough
to test it.
Like I said, I will be happy to test as soon as I can dig the hardware
out. In any event, this is broken.
quoted hunk ↗ jump to hunk
static int
typhoon_request_firmware(struct typhoon *tp)
@@ -1367,12 +1368,22 @@ typhoon_request_firmware(struct typhoon *tp)
memcmp(typhoon_fw->data, "TYPHOON", 8)) {
printk(KERN_ERR "%s: Invalid firmware image\n",
tp->name);
- release_firmware(typhoon_fw);
- typhoon_fw = NULL;
- return -EINVAL;
+ err = -EINVAL;
+ goto out_err;
+ }
+
+ typhoon_fw_image = kmalloc(typhoon_fw->size, GFP_KERNEL);
+ if (!typhoon_fw_image) {
+ err = -ENOMEM;
+ goto out_err;
}
You never copied the image into the kmalloc'd memory, so you upload
garbage.
Fix that and I think it will be OK.