Linux ATA/IDE development
 help / color / mirror / Atom feed
* [PATCH 2.6.20-git] sata_svw: Check for errors from ata_device_add()
@ 2006-12-19 22:59 Ben Collins
  2006-12-19 23:33 ` Ben Collins
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Collins @ 2006-12-19 22:59 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Jeff Garzik; +Cc: Linux Kernel List, linux-ide

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.

Signed-off-by: Ben Collins <bcollins@ubuntu.com>

diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index d89c959..85911b4 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-19 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19 22:59 [PATCH 2.6.20-git] sata_svw: Check for errors from ata_device_add() Ben Collins
2006-12-19 23:33 ` Ben Collins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox