net/local/local_conn.c: Removed un-ncessary memset(). Connection structure is allocated with kmm_zalloc() which will clear all memory.

This commit is contained in:
Gregory Nutt 2019-09-01 11:23:40 -06:00
parent 6266e067e9
commit d596e56c3d

View File

@ -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
}