Skip to content

Commit

Permalink
core: __port_read/write: report NULL block
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
  • Loading branch information
kmarkus committed Apr 19, 2020
1 parent 122a19c commit 4ae9566
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libubx/ubx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,12 @@ long __port_read(const ubx_port_t *port, ubx_data_t *data)
int ret = 0;
ubx_block_t **iaptr;

if (!port) {
if (port == NULL) {
if (port->block != NULL)
ubx_err(port->block, "%s: port is NULL", __func__);
else
ERR("port NULL");

ret = EINVALID_PORT;
goto out;
}
Expand Down Expand Up @@ -2397,7 +2402,10 @@ void __port_write(const ubx_port_t *port, const ubx_data_t *data)
ubx_block_t **iaptr;

if (port == NULL) {
ERR("port null");
if (port->block != NULL)
ubx_err(port->block, "%s: port is NULL", __func__);
else
ERR("port NULL");
goto out;
}

Expand Down

0 comments on commit 4ae9566

Please sign in to comment.