From: Stefano Babic Date: Wed, 22 Feb 2012 00:24:37 +0000 (+0000) Subject: SATA: check for return value from sata functions X-Git-Tag: v2012.07-rc1~144^2~98 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=71cadda3ff8e0607c7b927582e1d9c9913857e6a;p=u-boot 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 CC: Dirk Behme CC: Fabio Estevam --- diff --git a/common/cmd_sata.c b/common/cmd_sata.c index 7b1703fe41..3f98235a38 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;