Thread (13 messages) 13 messages, 3 authors, 2009-03-03

Re: [PATCH v2] typhoon: Use request_firmware()

From: David Dillow <dave@thedillows.org>
Date: 2009-03-02 07:56:23

Possibly related (same subject, not in this thread)

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help