goto err_free;
if (beaglelogic_tcp_detect(devc) != SR_OK)
goto err_free;
+ if (devc->beaglelogic->close(devc) != SR_OK)
+ goto err_free;
sr_info("BeagleLogic device found at %s : %s",
devc->address, devc->port);
}
struct dev_context *devc = sdi->priv;
/* Open BeagleLogic */
- if (devc->beaglelogic == &beaglelogic_native_ops)
- if (devc->beaglelogic->open(devc))
- return SR_ERR;
+ if (devc->beaglelogic->open(devc))
+ return SR_ERR;
/* Set fd and local attributes */
if (devc->beaglelogic == &beaglelogic_tcp_ops)