Skip to contentSkip to conversation

fore200: fix oops on failed firmware load

PATCH Applied Meelis Roos 2 participants 2 messages Feb 10, 2009 – Feb 11, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fore200: fix oops on failed firmware load

Fore 200 ATM driver fails to handle request_firmware failures and oopses when no firmware file was found. Fix it by checking for the right return values and propaganting the return value up.

drivers/atm/fore200e.c +2 -2
index 937c9c0..10f000d 100644
@@ -2519,8 +2519,8 @@ fore200e_load_and_start_fw(struct fore200e* fore200e)
 	return err;
 
     sprintf(buf, "%s%s", fore200e->bus->proc_name, FW_EXT);
-    if (request_firmware(&firmware, buf, device) == 1) {
-	printk(FORE200E "missing %s firmware image\n", fore200e->bus->model_name);
+    if ((err = request_firmware(&firmware, buf, device)) < 0) {
+	printk(FORE200E "problem loading firmware image %s\n", fore200e->bus->model_name);
 	return err;
     }
 
Signature · 1 line
Meelis Roos ([email protected])
maintainer Applied
#1 lore raw

From: Meelis Roos <[email protected]>
Date: Tue, 10 Feb 2009 19:39:24 +0200 (EET)

Quoted 5 lines

Fore 200 ATM driver fails to handle request_firmware failures and oopses when no firmware file was found. Fix it by checking for the right return values and propaganting the return value up.

Applied, thank you.