Skip to contentSkip to conversation

sata_via: restore vt*_prepare_host error handling

PATCH Applied Marcin Slusarz 3 participants 3 messages Nov 2, 2008 – Nov 4, 2008 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sata_via: restore vt*_prepare_host error handling

commit b9d5b89b487517cbd4cb4702da829e07ef9e4432 (sata_via: fix support for 5287) accidently (?) removed vt*_prepare_host error handling - restore it

catched by gcc:
drivers/ata/sata_via.c: In function 'svia_init_one':
drivers/ata/sata_via.c:567: warning: 'host' may be used uninitialized in this function

Cc Tejun Heo <[email protected]>
Cc Joseph Chan <[email protected]>
Cc Jeff Garzik <[email protected]>
---
 drivers/ata/sata_via.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/ata/sata_via.c +3 -1
index 62367fe..c18935f 100644
@@ -602,8 +602,10 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		rc = vt8251_prepare_host(pdev, &host);
 		break;
 	default:
-		return -EINVAL;
+		rc = -EINVAL;
 	}
+	if (rc)
+		return rc;
 
 	svia_configure(pdev);
 
Signature · 1 line
1.5.6.4
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Marcin Slusarz

commit b9d5b89b487517cbd4cb4702da829e07ef9e4432 (sata_via: fix support for 5287) accidently (?) removed vt*_prepare_host error handling - restore it

catched by gcc:
drivers/ata/sata_via.c: In function 'svia_init_one':
drivers/ata/sata_via.c:567: warning: 'host' may be used uninitialized in this function

Cc Tejun Heo <[email protected]>
Cc Joseph Chan <[email protected]>
Cc Jeff Garzik <[email protected]>

Thank you.

Signature · 1 line
tejun
Applied
#2 lore raw
In reply to Marcin Slusarz
Quoted 20 lines · Marcin Slusarz

commit b9d5b89b487517cbd4cb4702da829e07ef9e4432 (sata_via: fix support for 5287) accidently (?) removed vt*_prepare_host error handling - restore it

catched by gcc:
drivers/ata/sata_via.c: In function 'svia_init_one':
drivers/ata/sata_via.c:567: warning: 'host' may be used uninitialized in this function

Cc Tejun Heo <[email protected]>
Cc Joseph Chan <[email protected]>
Cc Jeff Garzik <[email protected]>
---
 drivers/ata/sata_via.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/ata/sata_via.c +0 -0
index 62367fe..c18935f 100644

drivers/ata/sata_via.c static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · line 608

Quoted 8 lines
drivers/ata/sata_via.c +3 -1
@@ -602,8 +602,10 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		rc = vt8251_prepare_host(pdev, &host);
 		break;
 	default:
-		return -EINVAL;
+		rc = -EINVAL;
 	}
+	if (rc)
+		return rc;

applied