Skip to contentSkip to conversation

drivers/mtd/spi/eeprom_m95xxx.c: add missing error checking

PATCH New Albin Tonnerre 2 participants 2 messages Mar 14, 2010 – Apr 9, 2010 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/mtd/spi/eeprom_m95xxx.c: add missing error checking

---
 drivers/mtd/spi/eeprom_m95xxx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/mtd/spi/eeprom_m95xxx.c +6 -0
index 0148d00..632db4e 100644
@@ -44,6 +44,9 @@ ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int len)
 
 	slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
 			CONFIG_DEFAULT_SPI_MODE);
+	if(!slave)
+		return 0;
+
 	spi_claim_bus(slave);
 
 	/* command */
@@ -75,6 +78,9 @@ ssize_t spi_write (uchar *addr, int alen, uchar *buffer, int len)
 
 	slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, 1, 1000000,
 			CONFIG_DEFAULT_SPI_MODE);
+	if (!slave)
+		return 0;
+
 	spi_claim_bus(slave);
 
 	buf[0] = SPI_EEPROM_WREN;
Signature · 1 line
1.7.0
#1 lore raw

PATCH 1/1 drivers/mtd/spi/eeprom_m95xxx.c: add missing error checking

Dear Albin Tonnerre,

Quoted 4 lines · In message <1268588843-23451-1-git-send-email-albin.tonnerre@free-electrons.com…
---
 drivers/mtd/spi/eeprom_m95xxx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Lispers are among  the  best  grads  of  the  Sweep-It-Under-Someone-
Else's-Carpet  School of Simulated Simplicity. [Was that sufficiently
incendiary? :-)]  - Larry Wall in <[email protected]