Skip to contentSkip to conversation

sata_svw: Check for errors from ata_device_add()

PATCH In review Ben Collins 1 participant 2 messages Dec 19, 2006 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sata_svw: Check for errors from ata_device_add()

Without this patch, G5 oopses on boot. I've had this in Ubuntu since 2.6.17, but I forgot it was in there. Still required with 2.6.20.

drivers/ata/sata_svw.c +4 -4
index d89c959..85911b4 100644
@@ -473,11 +473,11 @@ static int k2_sata_init_one (struct pci_
 
 	pci_set_master(pdev);
 
-	/* FIXME: check ata_device_add return value */
-	ata_device_add(probe_ent);
-	kfree(probe_ent);
+	if (ata_device_add(probe_ent))
+		return 0;
 
-	return 0;
+	/* Failed to add, no device present */
+	rc = -ENODEV;
 
 err_out_free_ent:
 	kfree(probe_ent);
#1 lore raw
Quoted 4 lines · Ben Collins

Without this patch, G5 oopses on boot. I've had this in Ubuntu since 2.6.17, but I forgot it was in there. Still required with 2.6.20.

Ignore this patch for now, BenH and I are discussing the issue further.