Skip to contentSkip to conversation

Fix return codes in failure case.

IPMI Dave Jones 2 participants 2 messages Oct 18, 2006 IPMI

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

These returns should be negative, like the others in this function.

drivers/char/ipmi/ipmi_si_intf.c +2 -2
index 24825bd..e5cfb1f 100644
@@ -1789,7 +1789,7 @@ static int __devinit ipmi_pci_probe(stru
 
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
-		return ENOMEM;
+		return -ENOMEM;
 
 	info->addr_source = "PCI";
 
@@ -1810,7 +1810,7 @@ static int __devinit ipmi_pci_probe(stru
 		kfree(info);
 		printk(KERN_INFO "ipmi_si: %s: Unknown IPMI type: %d\n",
 		       pci_name(pdev), class_type);
-		return ENOMEM;
+		return -ENOMEM;
 	}
 
 	rv = pci_enable_device(pdev);
Signature · 1 line
http://www.codemonkey.org.uk
#1 lore raw

Thanks, looks good.

-Corey

Quoted 28 lines · Dave Jones

These returns should be negative, like the others in this function.

drivers/char/ipmi/ipmi_si_intf.c +2 -2
index 24825bd..e5cfb1f 100644
@@ -1789,7 +1789,7 @@ static int __devinit ipmi_pci_probe(stru
 
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
-		return ENOMEM;
+		return -ENOMEM;
 
 	info->addr_source = "PCI";
 
@@ -1810,7 +1810,7 @@ static int __devinit ipmi_pci_probe(stru
 		kfree(info);
 		printk(KERN_INFO "ipmi_si: %s: Unknown IPMI type: %d\n",
 		       pci_name(pdev), class_type);
-		return ENOMEM;
+		return -ENOMEM;
 	}
 
 	rv = pci_enable_device(pdev);