From patchwork Wed Feb 14 20:11:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10219905 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 9F599601C2 for ; Wed, 14 Feb 2018 20:13:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7644E28B40 for ; Wed, 14 Feb 2018 20:13:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B14828B44; Wed, 14 Feb 2018 20:13:10 +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 73EE4289E0 for ; Wed, 14 Feb 2018 20:13:09 +0000 (UTC) Received: (qmail 17457 invoked by uid 550); 14 Feb 2018 20:12:20 -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 16278 invoked from network); 14 Feb 2018 20:12:16 -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=p41W8TPKQfQSTAck/C3d5bTWDT6YCXIa+sGEUSNRcpA=; b=BwI/B++7hlE4iQI2BDuE3ss49 zj5IpKCRjoIiapOtci7IEDn0X4+vC2N0FmyEIp0EA6bk8XUT1FxmM1Kv6okw8zkEjbK1CuTJioL2n ta0zuOx/gR7+CpkVrJmnq3M4hjoOtONo7wH90+Av7AA4++cSqnaEPWCZnXo+dFxwrpBeGOSUE7stn DRF49Ahe9cysJ8HMuizE5pnvUUS/YTao01Y9jtxdBFH4xD5vFvbyllugWRnwwTtQ4zRbr14YaD9+1 Ni34hzq4MqNwUEf/gyctCnQiJ6vbG5FV+YspYrlz/V3cKe64dtZADEAjqmIidcb6CGp7KNDp1gOQ4 wjP9vxspA==; 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 6/8] Convert v4l2 event to kvzalloc_struct Date: Wed, 14 Feb 2018 12:11:52 -0800 Message-Id: <20180214201154.10186-7-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/media/v4l2-core/v4l2-event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c index 968c2eb08b5a..20afb01301e8 100644 --- a/drivers/media/v4l2-core/v4l2-event.c +++ b/drivers/media/v4l2-core/v4l2-event.c @@ -215,8 +215,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, if (elems < 1) elems = 1; - sev = kvzalloc(sizeof(*sev) + sizeof(struct v4l2_kevent) * elems, - GFP_KERNEL); + sev = kvzalloc_struct(sev, events, elems, GFP_KERNEL); if (!sev) return -ENOMEM; for (i = 0; i < elems; i++)