Skip to contentSkip to conversation

Correct error handling in rtcan_ixxat_pci.c if card has wrong sub_sys_id

PATCH New Sebastian Smolorz 1 participant 1 message Mar 10, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correct error handling in rtcan_ixxat_pci.c if card has wrong sub_sys_id

Hi,

the subject says it all. The patch is only compile-tested.

Signature · 1 line
Sebastian
drivers/can/sja1000/rtcan_ixxat_pci.c +4 -2
Index: ksrc/drivers/can/sja1000/rtcan_ixxat_pci.c
===================================================================
@@ -223,8 +223,10 @@ static int __devinit ixxat_pci_init_one 
     RTCAN_DBG("%s: Initializing device %04x:%04x:%04x\n",
 	      RTCAN_DRV_NAME, pdev->vendor, pdev->device, sub_sys_id);
 
-    if (sub_sys_id != IXXAT_PCI_SUB_SYS_ID)
-	    return -ENODEV;
+    if (sub_sys_id != IXXAT_PCI_SUB_SYS_ID) {
+	ret = -ENODEV;
+	goto failure_release_pci;
+    }
 
     /* Enable memory and I/O space */
     if ((ret = pci_write_config_word(pdev, 0x04, 0x3)))