sr: chronovu-la8: fix segfault on discovery

If the uninitialized value didn't happen to contain 0, and there
is no Chronovu LA8 connected, the la8_close() causes a segfault
in libftdi.
This commit is contained in:
Bert Vermeulen 2012-07-24 00:50:02 +02:00
parent 74e5f12d3d
commit d67b663e21
1 changed files with 1 additions and 0 deletions

View File

@ -70,6 +70,7 @@ static int hw_init(const char *devinfo)
ctx->done = 0; ctx->done = 0;
ctx->block_counter = 0; ctx->block_counter = 0;
ctx->divcount = 0; /* 10ns sample period == 100MHz samplerate */ ctx->divcount = 0; /* 10ns sample period == 100MHz samplerate */
ctx->usb_pid = 0;
/* Allocate memory where we'll store the de-mangled data. */ /* Allocate memory where we'll store the de-mangled data. */
if (!(ctx->final_buf = g_try_malloc(SDRAM_SIZE))) { if (!(ctx->final_buf = g_try_malloc(SDRAM_SIZE))) {