lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1425486941-10121-1-git-send-email-codehero@gmail.com>
Date:	Wed,  4 Mar 2015 11:35:41 -0500
From:	David Bender <codehero@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	David Bender <codehero@...il.com>, Dave Bender <bender@...egon.com>
Subject: [PATCH] omap-mcspi: When overriding SPI settings do not clobber status return value

The call to omap2_mcspi_setup_transfer(spi, NULL) clobbers the previous
status value, possibly masking hardware transfer errors. Instead record
a separate status for this call. Give preference to reporting a hardware
transfer error over any error returned by omap2_mcspi_setup_transfer()

Signed-off-by: Dave Bender <bender@...egon.com>
---
 drivers/spi/spi-omap2-mcspi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 4df8942..6a4bd08 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1180,8 +1180,10 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, struct spi_message *m)
 	}
 	/* Restore defaults if they were overriden */
 	if (par_override) {
+		int status_transfer;
 		par_override = 0;
-		status = omap2_mcspi_setup_transfer(spi, NULL);
+		status_transfer = omap2_mcspi_setup_transfer(spi, NULL);
+		status = status ? status : status_transfer;
 	}
 
 	if (cs_active)
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ