From patchwork Sun Jul 3 22:04:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 643847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rjPYK0j5Bz9ssP for ; Mon, 4 Jul 2016 08:13:25 +1000 (AEST) Received: from localhost ([::1]:44330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJpdj-0007IE-49 for incoming@patchwork.ozlabs.org; Sun, 03 Jul 2016 18:13:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJpVa-0004US-Eb for qemu-devel@nongnu.org; Sun, 03 Jul 2016 18:04:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJpVV-0001zf-1f for qemu-devel@nongnu.org; Sun, 03 Jul 2016 18:04:57 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:38978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJpVU-0001zT-RY for qemu-devel@nongnu.org; Sun, 03 Jul 2016 18:04:52 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 4DE518D58; Mon, 4 Jul 2016 00:04:44 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FO7ETzbJtFaN; Mon, 4 Jul 2016 00:04:44 +0200 (CEST) Received: from var.youpi.perso.aquilenet.fr (unknown [IPv6:2a01:cb19:1af:4600:3602:86ff:fe2c:6a19]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A46578D56; Mon, 4 Jul 2016 00:04:43 +0200 (CEST) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.87) (envelope-from ) id 1bJpVP-0002DO-4c; Mon, 04 Jul 2016 00:04:47 +0200 From: Samuel Thibault To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Mon, 4 Jul 2016 00:04:42 +0200 Message-Id: <1467583483-8462-6-git-send-email-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1467583483-8462-1-git-send-email-samuel.thibault@ens-lyon.org> References: <1467583483-8462-1-git-send-email-samuel.thibault@ens-lyon.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 141.255.128.1 Subject: [Qemu-devel] [PULL 5/6] slirp: Remove superfluous memset() calls from the TFTP code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jan.kiszka@siemens.com, Thomas Huth , Samuel Thibault Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth 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 Signed-off-by: Samuel Thibault --- 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);