diff --git a/net/local/local_conn.c b/net/local/local_conn.c index 183d49b4f28..918835d3ac6 100644 --- a/net/local/local_conn.c +++ b/net/local/local_conn.c @@ -87,12 +87,12 @@ FAR struct local_conn_s *local_alloc(void) FAR struct local_conn_s *conn = (FAR struct local_conn_s *)kmm_zalloc(sizeof(struct local_conn_s)); - if (conn) + if (conn != NULL) { - /* Initialize non-zero elements the new connection structure */ - - conn->lc_infile.f_inode = NULL; - conn->lc_outfile.f_inode = NULL; + /* Initialize non-zero elements the new connection structure. Since + * Since the memory was allocated with kmm_zalloc(), it is not + * necessary to zerio-ize any structure elements. + */ #ifdef CONFIG_NET_LOCAL_STREAM /* This semaphore is used for signaling and, hence, should not have @@ -101,10 +101,6 @@ FAR struct local_conn_s *local_alloc(void) nxsem_init(&conn->lc_waitsem, 0, 0); nxsem_setprotocol(&conn->lc_waitsem, SEM_PRIO_NONE); - -#ifdef HAVE_LOCAL_POLL - memset(conn->lc_accept_fds, 0, sizeof(conn->lc_accept_fds)); -#endif #endif }