From patchwork Sat Mar 12 08:39:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pooja Dhannawat X-Patchwork-Id: 8571111 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7F4DC0553 for ; Sat, 12 Mar 2016 08:42:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C05220361 for ; Sat, 12 Mar 2016 08:42:39 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id A74E02035E for ; Sat, 12 Mar 2016 08:42:38 +0000 (UTC) Received: from localhost ([::1]:59480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aef89-0006da-QY for patchwork-qemu-devel@patchwork.kernel.org; Sat, 12 Mar 2016 03:42:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aef83-0006dU-Le for qemu-devel@nongnu.org; Sat, 12 Mar 2016 03:42:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aef7y-0004zh-MP for qemu-devel@nongnu.org; Sat, 12 Mar 2016 03:42:31 -0500 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:33294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aef7y-0004yn-FT for qemu-devel@nongnu.org; Sat, 12 Mar 2016 03:42:26 -0500 Received: by mail-pf0-x22f.google.com with SMTP id 124so100391952pfg.0 for ; Sat, 12 Mar 2016 00:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=ZuDKWSCjxNTkyhUEWDgJO+1wGZKbwu4a/T6znaXNqJI=; b=pC56lGhrh9REPuuPeBDyiA6dJJY7x3ptkZQfs33lPoTJKZz+ywasr4lVRLsJh7Ca7T aWG9oWv8gcaPskCO6Hxgza2ojgFoc6MwOMBY8wiRNVKLYU0x+ib4GxE1kOeDJ7a71PI8 gnpk9yhU039ULmVq8UrwpEUEUes6lzlq889LKR7OlVPdBKycdcJUy4VMGd9zmAZJRCZe STbUkynSmrVpPW1sSXkSLiOmhJqD+0UJHj5slBRk0aKNcfx/VAQhbqMh+k4DHpM+Id+s UlJA30ydz+Uw6j0zdlC5w4TcXpbnhV8hRz49Ag172J2Q0J1mPriJijSlx6+GD8uym5dy JMkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=ZuDKWSCjxNTkyhUEWDgJO+1wGZKbwu4a/T6znaXNqJI=; b=b6dN6TcKAP9Y0f9mPoBpBTs/E7ocL4la0jIgA75ct9Z17xdqNsLL/r54i401xTKtyH npv9BTjfnfsAafFXVMvE+UD5fQsobpV2jOk14v1p6x8lDufBXHCAk0AharfxSWCkYEqx sIju2nbKG46SAkgMIvg7U2e5RBqEJ5g8CSzPGYXt3PdEPP6h+Nx5rh9/BCjoxXsxE2Kj yupy4pPKD4+5riVlHFdfDK8Jp9jP3DFsBmaLcsJ64hxBQvcNONiwHRWR3+WDsG1URl/N 0aNQvC5AJxF0Zt6eezD3krV6dLDZv+jFtFysI5pN8EiIF82RwGrTXFWSY9gQNeV7NnQc XFBg== X-Gm-Message-State: AD7BkJIfnyhlb4HLD19heiR15RIeH2D7sYr7LuWtEXqKfBgNsoduNxHDmhIj3deCyfCS7w== X-Received: by 10.98.67.67 with SMTP id q64mr14548908pfa.44.1457772145494; Sat, 12 Mar 2016 00:42:25 -0800 (PST) Received: from localhost.localdomain ([183.87.60.98]) by smtp.gmail.com with ESMTPSA id ko9sm18084695pab.37.2016.03.12.00.42.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 Mar 2016 00:42:24 -0800 (PST) From: Pooja Dhannawat To: qemu-devel@nongnu.org Date: Sat, 12 Mar 2016 14:09:33 +0530 Message-Id: <1457771973-23208-1-git-send-email-dhannawatpooja1@gmail.com> X-Mailer: git-send-email 2.5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::22f Subject: [Qemu-devel] [Patch 1/1] net/net: Allocating Large sized arrays to heap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_HI, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pooja Dhannawat --- net/net.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/net.c b/net/net.c index b0c832e..5399758 100644 --- a/net/net.c +++ b/net/net.c @@ -709,16 +709,18 @@ ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size) static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov, int iovcnt, unsigned flags) { - uint8_t buf[NET_BUFSIZE]; + uint8_t *buf; uint8_t *buffer; size_t offset; + buf = g_new(uint8_t, 1); + if (iovcnt == 1) { buffer = iov[0].iov_base; offset = iov[0].iov_len; } else { buffer = buf; - offset = iov_to_buf(iov, iovcnt, 0, buf, sizeof(buf)); + offset = iov_to_buf(iov, iovcnt, 0, (uint8_t *)buf, sizeof(uint8_t)); } if (flags & QEMU_NET_PACKET_FLAG_RAW && nc->info->receive_raw) { @@ -726,6 +728,8 @@ static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov, } else { return nc->info->receive(nc, buffer, offset); } + + g_free(buf); } ssize_t qemu_deliver_packet_iov(NetClientState *sender,