1 From 5b37d183ef45f83c23f7a85d3bc87708fb07598a Mon Sep 17 00:00:00 2001
2 From: Stefano Babic <sbabic@denx.de>
3 Date: Wed, 22 Feb 2012 00:24:37 +0000
4 Subject: [PATCH 02/56] SATA: check for return value from sata functions
6 sata functions are called even if previous functions failed
7 because return value is not checked.
9 Signed-off-by: Stefano Babic <sbabic@denx.de>
10 CC: Dirk Behme <dirk.behme@de.bosch.com>
11 CC: Fabio Estevam <fabio.estevam@freescale.com>
13 common/cmd_sata.c | 9 ++++++---
14 1 file changed, 6 insertions(+), 3 deletions(-)
16 diff --git a/common/cmd_sata.c b/common/cmd_sata.c
17 index 7b1703f..3f98235 100644
18 --- a/common/cmd_sata.c
19 +++ b/common/cmd_sata.c
20 @@ -48,9 +48,12 @@ int __sata_initialize(void)
21 sata_dev_desc[i].block_write = sata_write;
25 - if ((sata_dev_desc[i].lba > 0) && (sata_dev_desc[i].blksz > 0))
26 - init_part(&sata_dev_desc[i]);
29 + if (!rc && (sata_dev_desc[i].lba > 0) &&
30 + (sata_dev_desc[i].blksz > 0))
31 + init_part(&sata_dev_desc[i]);