dev_acquisition_start(): Ensure that sdi is always != NULL.

This commit is contained in:
Uwe Hermann 2016-04-15 16:26:43 +02:00
parent 8cb222e143
commit df3ea149cc
1 changed files with 5 additions and 1 deletions

View File

@ -811,7 +811,11 @@ SR_API int sr_session_start(struct sr_session *session)
/* Have all devices start acquisition. */ /* Have all devices start acquisition. */
for (l = session->devs; l; l = l->next) { for (l = session->devs; l; l = l->next) {
sdi = l->data; if (!(sdi = l->data)) {
sr_err("Device sdi was NULL, can't start session.");
ret = SR_ERR;
break;
}
ret = sdi->driver->dev_acquisition_start(sdi); ret = sdi->driver->dev_acquisition_start(sdi);
if (ret != SR_OK) { if (ret != SR_OK) {
sr_err("Could not start %s device %s acquisition.", sr_err("Could not start %s device %s acquisition.",