From: Bert Vermeulen Date: Mon, 23 Jul 2012 22:50:02 +0000 (+0200) Subject: sr: chronovu-la8: fix segfault on discovery X-Git-Tag: dsupstream~861 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d67b663e21de64261847c7e68de3ba37883c48b7;p=libsigrok.git 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. --- diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index 81466917..5b82c3ab 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -70,6 +70,7 @@ static int hw_init(const char *devinfo) ctx->done = 0; ctx->block_counter = 0; ctx->divcount = 0; /* 10ns sample period == 100MHz samplerate */ + ctx->usb_pid = 0; /* Allocate memory where we'll store the de-mangled data. */ if (!(ctx->final_buf = g_try_malloc(SDRAM_SIZE))) {