From d596e56c3db0a767fc924ba9124a3ee177ce5af4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 1 Sep 2019 11:23:40 -0600 Subject: [PATCH] net/local/local_conn.c: Removed un-ncessary memset(). Connection structure is allocated with kmm_zalloc() which will clear all memory. --- net/local/local_conn.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/net/local/local_conn.c b/net/local/local_conn.c index 183d49b4f2..918835d3ac 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 }