beaglelogic: fixup use of uninitialized data in TCP routines
Make sure that failure to communicate via TCP results in access to uninitialized data. This was reported by clang's scan-build.
This commit is contained in:
parent
71f2000bfb
commit
05b0cc416f
|
@ -172,6 +172,7 @@ static int beaglelogic_tcp_get_string(struct dev_context *devc, const char *cmd,
|
|||
int len;
|
||||
gint64 timeout;
|
||||
|
||||
*tcp_resp = NULL;
|
||||
if (cmd) {
|
||||
if (beaglelogic_tcp_send_cmd(devc, cmd) != SR_OK)
|
||||
return SR_ERR;
|
||||
|
@ -288,9 +289,11 @@ static int beaglelogic_get_samplerate(struct dev_context *devc)
|
|||
int arg, err;
|
||||
|
||||
err = beaglelogic_tcp_get_int(devc, "samplerate", &arg);
|
||||
devc->cur_samplerate = arg;
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return err;
|
||||
devc->cur_samplerate = arg;
|
||||
return SR_OK;
|
||||
}
|
||||
|
||||
static int beaglelogic_set_samplerate(struct dev_context *devc)
|
||||
|
|
Loading…
Reference in New Issue