From patchwork Wed Feb 14 20:11:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10219903 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 5D60E601C2 for ; Wed, 14 Feb 2018 20:13:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1EBB2893D for ; Wed, 14 Feb 2018 20:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 966A328B40; Wed, 14 Feb 2018 20:12:57 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id D7A812893D for ; Wed, 14 Feb 2018 20:12:56 +0000 (UTC) Received: (qmail 16277 invoked by uid 550); 14 Feb 2018 20:12:16 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 16201 invoked from network); 14 Feb 2018 20:12:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WthBHKenLHBX182ogxZHxPTpCq6cnWX6LosdoqkvTKs=; b=KUK+5n40KgWQXzwvi8sqU/XD9 4QVXKBPVgUuE1LIwohrvxZhbmTgwddyP38nkP2oTmQoDmY5wYxFgU1hqEuE4JkV4rwvsh7kfMDT/x HTcwC4EWhqX7l19PaP/QPOX9FdmLmKd8mHCYn5FZUvB6oOX4t82enxmaOFTT8gqfvLn1874dHS71M lWENvBBKqY0IzP7VG59w7YifkxiECO4I0AKM+pM1K6ZQk1ojP1JG6Hrl0E4Jq/T3tZWLFiTH/yMGK zcM51M5vFPmZ4orBQy2ilnTTNhlqqhFnEV6JjSP2oWNdn/Jq+tse1jIwmWvgpdBVixrI0LYaBX5ML oseNrIgeA==; From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-mm@kvack.org, Kees Cook , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Joe Perches Subject: [PATCH v2 3/8] Convert virtio_console to kvzalloc_struct Date: Wed, 14 Feb 2018 12:11:49 -0800 Message-Id: <20180214201154.10186-4-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180214201154.10186-1-willy@infradead.org> References: <20180214201154.10186-1-willy@infradead.org> X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- drivers/char/virtio_console.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 468f06134012..e0816cc2c6bd 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -433,8 +433,7 @@ static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size, * Allocate buffer and the sg list. The sg list array is allocated * directly after the port_buffer struct. */ - buf = kmalloc(sizeof(*buf) + sizeof(struct scatterlist) * pages, - GFP_KERNEL); + buf = kvzalloc_struct(buf, sg, pages, GFP_KERNEL); if (!buf) goto fail;