aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2012-02-22 00:24:37 +0000
committerJohn Rigby <john.rigby@linaro.org>2012-05-04 16:28:45 -0600
commitad7d899648147f8a65ee36b54d5c61fb3b374bd8 (patch)
treea1e1a3311b5bf7d032c304992db4d510b1019e90
parent51b22adbde32e96807ac9a0657c0d31d77b94fa3 (diff)
downloadu-boot-linaro-stable-ad7d899648147f8a65ee36b54d5c61fb3b374bd8.tar.gz
SATA: check for return value from sata functions
sata functions are called even if previous functions failed because return value is not checked. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Dirk Behme <dirk.behme@de.bosch.com> CC: Fabio Estevam <fabio.estevam@freescale.com>
-rw-r--r--common/cmd_sata.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/cmd_sata.c b/common/cmd_sata.c
index 7b1703fe4..3f98235a3 100644
--- a/common/cmd_sata.c
+++ b/common/cmd_sata.c
@@ -48,9 +48,12 @@ int __sata_initialize(void)
sata_dev_desc[i].block_write = sata_write;
rc = init_sata(i);
- rc = scan_sata(i);
- if ((sata_dev_desc[i].lba > 0) && (sata_dev_desc[i].blksz > 0))
- init_part(&sata_dev_desc[i]);
+ if (!rc) {
+ rc = scan_sata(i);
+ if (!rc && (sata_dev_desc[i].lba > 0) &&
+ (sata_dev_desc[i].blksz > 0))
+ init_part(&sata_dev_desc[i]);
+ }
}
sata_curr_device = 0;
return rc;