From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHTzA-0007GG-4V for qemu-devel@nongnu.org; Mon, 27 Jun 2016 06:41:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHTz4-0001TL-6o for qemu-devel@nongnu.org; Mon, 27 Jun 2016 06:41:47 -0400 From: Thomas Huth Date: Mon, 27 Jun 2016 12:41:36 +0200 Message-Id: <1467024096-17942-1-git-send-email-thuth@redhat.com> Subject: [Qemu-devel] [PATCH] slirp: Remove superfluous memset() calls from the TFTP code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault , qemu-devel@nongnu.org Cc: Jan Kiszka , qemu-trivial@nongnu.org Commit fad7fb9ccd8013ea03 ("Add IPv6 support to the TFTP code") refactored some common code for preparing the mbuf into a new function called tftp_prep_mbuf_data(). One part of this common code is to do a "memset(m->m_data, 0, m->m_size);" for the related buffer first. However, at two spots, the memset() was not removed from the calling function, so it currently done twice in these code paths. Thus let's delete these superfluous memsets in the calling functions now. Signed-off-by: Thomas Huth --- slirp/tftp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/slirp/tftp.c b/slirp/tftp.c index 12b5ff6..3673402 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -208,8 +208,6 @@ static void tftp_send_error(struct tftp_session *spt, goto out; } - memset(m->m_data, 0, m->m_size); - tp = tftp_prep_mbuf_data(spt, m); tp->tp_op = htons(TFTP_ERROR); @@ -237,8 +235,6 @@ static void tftp_send_next_block(struct tftp_session *spt, return; } - memset(m->m_data, 0, m->m_size); - tp = tftp_prep_mbuf_data(spt, m); tp->tp_op = htons(TFTP_DATA); -- 1.8.3.1