X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=65a626ffa79c589d63044cc9cf914723989e7e7a;hp=c3d5fd8fff5d6b594d3e98e57ac26df418fd84ea;hb=2b9a3c8226573d507149b8ca6e5a925229dd691d;hpb=99404ad5ac076785991e179d3ce9332857a0ca7f diff --git a/src/ftdi.c b/src/ftdi.c index c3d5fd8..65a626f 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2261,6 +2261,7 @@ void ftdi_eeprom_free(struct ftdi_context *ftdi) \retval -3: Invalid cbus function setting \retval -4: Chip doesn't support invert \retval -5: Chip doesn't support high current drive + \retval -6: No connected EEPROM or EEPROM Type unknown */ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) { @@ -2278,6 +2279,9 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) eeprom= ftdi->eeprom; + if(eeprom->chip == -1) + ftdi_error_return(-5,"No connected EEPROM or EEPROM Type unknown"); + if (eeprom->manufacturer != NULL) manufacturer_size = strlen(eeprom->manufacturer); if (eeprom->product != NULL)