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: 9211487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 55A536075F for ; Sun, 3 Jul 2016 22:12:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38C49286DB for ; Sun, 3 Jul 2016 22:12:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2ADC5286DE; Sun, 3 Jul 2016 22:12:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB5B9286DB for ; Sun, 3 Jul 2016 22:12:58 +0000 (UTC) Received: from localhost ([::1]:44327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJpdJ-0006r7-EG for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Jul 2016 18:12:57 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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);