Make sure that failure to communicate via TCP results in access to
uninitialized data.
This was reported by clang's scan-build.
int len;
gint64 timeout;
+ *tcp_resp = NULL;
if (cmd) {
if (beaglelogic_tcp_send_cmd(devc, cmd) != SR_OK)
return SR_ERR;
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)