eeprom->channel_a_type must be initialized
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Fri, 10 Sep 2010 19:36:11 +0000 (21:36 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 20 Sep 2010 13:34:42 +0000 (15:34 +0200)
src/ftdi.c

index 604d0c6..a8e38dd 100644 (file)
@@ -2630,6 +2630,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size,
         ftdi_error_return(-1,"EEPROM checksum error");
     }
 
+    eeprom->channel_a_type   = 0;
     if ((ftdi->type == TYPE_AM) || (ftdi->type == TYPE_BM))
     {
         eeprom->chip = -1;
@@ -2646,7 +2647,6 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size,
     }
     else if(ftdi->type == TYPE_R)
     {
-        eeprom->channel_a_type   = 0;
         /* TYPE_R flags D2XX, not VCP as all others*/
         eeprom->channel_a_driver = (~buf[0x00]) & DRIVER_VCP;
         eeprom->high_current     = buf[0x00] & HIGH_CURRENT_DRIVE_R;