Commit 6d034eae authored by Alessandro Rubini's avatar Alessandro Rubini

ptpd_netif: trivial fixes for unlikely errors

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 25f173e8
......@@ -271,6 +271,7 @@ wr_socket_t *ptpd_netif_create_socket(int sock_type, int flags,
}
s=calloc(sizeof(struct my_socket), 1);
if (!s) return NULL;
s->if_index = f.ifr_ifindex;
......@@ -303,6 +304,7 @@ int ptpd_netif_close_socket(wr_socket_t *sock)
return 0;
close(s->fd);
free(s);
return 0;
}
......@@ -755,4 +757,4 @@ int ptpd_netif_enable_phase_tracking(const char *if_name)
int ret = halexp_lock_cmd(if_name, HEXP_LOCK_CMD_ENABLE_TRACKING, 0);
return (ret < 0 ? PTPD_NETIF_ERROR : PTPD_NETIF_OK);
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment