Skip to contentSkip to conversation

ipmi: Check the return status of open firmware device registration

PATCH New Matthew Garrett 1 participant 1 message Jul 27, 2010 IPMI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipmi: Check the return status of open firmware device registration

If the registration of the Open Firmware IPMI device fails then we may attempt to unregister a device that doesn't exist. Check the return code.

---
 drivers/char/ipmi/ipmi_si_intf.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/char/ipmi/ipmi_si_intf.c +5 -2
index 094bdc3..e39a744 100644
@@ -3337,8 +3337,11 @@ static __devinit int init_ipmi_si(void)
 #endif
 
 #ifdef CONFIG_PPC_OF
-	of_register_platform_driver(&ipmi_of_platform_driver);
-	of_registered = 1;
+	rv = of_register_platform_driver(&ipmi_of_platform_driver);
+	if (rv)
+		printk(KERN_ERR PFX "Unable to register OF driver: %d\n", rv);
+	else
+		of_registered = 1;
 #endif
 
 	/* We prefer devices with interrupts, but in the case of a machine
Signature · 1 line
1.7.1.1