X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fstd.c;h=fed47febe3598e15468b0e2433b6decbd362fb48;hb=a5892391b02689d7babd98d44e6537b34cef8e80;hp=2319dfef9273f47524fd61bcebb7535f8f21135b;hpb=155b680da482cea2381becb73c51cfb838bff31e;p=libsigrok.git diff --git a/src/std.c b/src/std.c index 2319dfef..fed47feb 100644 --- a/src/std.c +++ b/src/std.c @@ -115,7 +115,7 @@ SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi, * * This function can be used to implement the dev_open() driver API * callback in drivers that use a serial port. The port is opened - * with the SERIAL_RDWR and SERIAL_NONBLOCK flags. + * with the SERIAL_RDWR flag. * * If the open succeeded, the status field of the given sdi is set * to SR_ST_ACTIVE. @@ -128,7 +128,7 @@ SR_PRIV int std_serial_dev_open(struct sr_dev_inst *sdi) struct sr_serial_dev_inst *serial; serial = sdi->conn; - if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) + if (serial_open(serial, SERIAL_RDWR) != SR_OK) return SR_ERR; sdi->status = SR_ST_ACTIVE; @@ -278,9 +278,12 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver, sr_scpi_free(sdi->conn); } if (clear_private) + /* The helper function is responsible for freeing + * its own sdi->priv! */ clear_private(sdi->priv); else g_free(sdi->priv); + sr_dev_inst_free(sdi); }