From patchwork Mon Dec 4 14:03:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10090329 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 6EAB960329 for ; Mon, 4 Dec 2017 14:03:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7724D287DE for ; Mon, 4 Dec 2017 14:03:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AAC028D1D; Mon, 4 Dec 2017 14:03:56 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,URIBL_DBL_ABUSE_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDF69287DE for ; Mon, 4 Dec 2017 14:03:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754260AbdLDODx (ORCPT ); Mon, 4 Dec 2017 09:03:53 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33509 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752138AbdLDODw (ORCPT ); Mon, 4 Dec 2017 09:03:52 -0500 Received: by mail-wr0-f194.google.com with SMTP id v22so17414353wrb.0 for ; Mon, 04 Dec 2017 06:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=christofferdall-dk.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=NZDL88KYHnHG1dfr5GLAsbmFC9VITmxGpkIX79zI0x4=; b=wGghl2RCdItdCHp5ICrZPtOZ3lUZ8p0ELOFkrrv6VneDnjOYC1YdLYvMBtvSee7EhQ 5n4Jpq/t7Vr2kI6KoWOpumQ8zCENDoUSYhJQtetti5/B1/+scZnbe4UhTqbhLzq67Tr0 rSoOLRNMLZyK7BuvySPoPo1kku3kVpRAOyGcLLyw5wKVFv7C8Psj7RJSdTHHIsbK82PS dX26i5GwFsLImZENf3Ls8r/6j0NQOgSCKmN+bwxrX9stnxmmXlnJyvIjxAko7bFR8e8H rjQ3ZPt++7+0txMwtyxffsZYJNgqcDlBerVJRGM3/KmInZ//6ifAOBMzZKEPsEMWBV/X MAdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=NZDL88KYHnHG1dfr5GLAsbmFC9VITmxGpkIX79zI0x4=; b=nTU3fbKfGF6uxWfqPLGXRz8ogQ30cnlGR9wSVNPyflJg+8I/mSbCDoAlc3yFJVmmbc jF7WCevp8+bULXF0ls5o4wFX3wvZP6J7aRZIq7xmJ7+aZSOEBY1gMHVuIde9gHcsQNZS OsLnaXzi/nZ9O/x+YzlksoNtxTpfcQ0S3jYdyhPYUkcJXRuMjFAn3/XtDlwXHcTwYcWC AW3rR72hx76sI6xiCeBRse5QM16w68n5Zwd+v44w5h1/cu+FNWk6FcM4CHYYes9z7QW4 IB5ls1ob8sLgWI+CAIyYK+laKvyZ6kd96+GNOhoHxATs5qovZBqHIpJzW1/g7TpFUIM+ nEUw== X-Gm-Message-State: AJaThX6iGMq/75ubZ6GzhhSwBLse2Ay78fZAfNqLqoQdIFr7pTYl53pC 0T2DxRQPkIXJGDbY0J+xlWa8+g== X-Google-Smtp-Source: AGs4zMZ8SPec1bpgpnz7yC3k7g2YpogLT2PBjcjMy5byfrQnSFVdTQJOtZ7txLQ6XEj2w2zsxc4wSQ== X-Received: by 10.223.150.2 with SMTP id b2mr12486512wra.185.1512396231607; Mon, 04 Dec 2017 06:03:51 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id g7sm22794279wra.38.2017.12.04.06.03.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 06:03:50 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , stable@vger.kernel.org, Christoffer Dall Subject: [PULL 03/19] KVM: arm/arm64: vgic-irqfd: Fix MSI entry allocation Date: Mon, 4 Dec 2017 15:03:32 +0100 Message-Id: <20171204140348.21965-1-cdall@kernel.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171204135637.21620-1-cdall@kernel.org> References: <20171204135637.21620-1-cdall@kernel.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier Using the size of the structure we're allocating is a good idea and avoids any surprise... In this case, we're happilly confusing kvm_kernel_irq_routing_entry and kvm_irq_routing_entry... Fixes: 95b110ab9a09 ("KVM: arm/arm64: Enable irqchip routing") Cc: # 4.8 Reported-by: AKASHI Takahiro Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- virt/kvm/arm/vgic/vgic-irqfd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/virt/kvm/arm/vgic/vgic-irqfd.c b/virt/kvm/arm/vgic/vgic-irqfd.c index b7baf581611a..99e026d2dade 100644 --- a/virt/kvm/arm/vgic/vgic-irqfd.c +++ b/virt/kvm/arm/vgic/vgic-irqfd.c @@ -112,8 +112,7 @@ int kvm_vgic_setup_default_irq_routing(struct kvm *kvm) u32 nr = dist->nr_spis; int i, ret; - entries = kcalloc(nr, sizeof(struct kvm_kernel_irq_routing_entry), - GFP_KERNEL); + entries = kcalloc(nr, sizeof(*entries), GFP_KERNEL); if (!entries) return -ENOMEM;