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: 10090345 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 5C7BB60329 for ; Mon, 4 Dec 2017 14:04:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43B382899A for ; Mon, 4 Dec 2017 14:04:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 387A828D1D; Mon, 4 Dec 2017 14:04:21 +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=-2.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, URIBL_DBL_ABUSE_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B1EB62899A for ; Mon, 4 Dec 2017 14:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=I6/vTJCDnr1C5b5PUA1Y7n+s3U+4DiXhVK4ng1U9D7g=; b=QOIE9xxevGAhAl8VDV3Swt3FO/ QZkHo2rVxWraAQKj1c0vtFWbGUqDoFvpgCBbVDPFWltUETOXy+uA8OUOVJYmG600n5pms1eInFign 4LFEu72tQfjDfnGIkGPYi1k+E6PB+ILWLtZ/KzIljNmFo3t8Wk/4uOg9wlVebI9HrVwyxaGxa5vl4 cpbfYGo6RBP1dpwJCfU7Kc/6y0hTf5nw9rD6hzp6L1YoS7D2fvjxSDkZh+7iy8HBOHgS9qjCchXCB BGeT9MXWRjKC/p5hoWspT02/3jqiKfXMdZZ3yFJd20qB6IYG51qIEAkVlw0ZaTZVvA8kQWaY/3eoK VjvFjpSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLrM1-0002Uo-D9; Mon, 04 Dec 2017 14:04:17 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLrLx-0002NW-HF for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2017 14:04:15 +0000 Received: by mail-wr0-x241.google.com with SMTP id s66so17394738wrc.9 for ; Mon, 04 Dec 2017 06:03:53 -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=n1tTseI+efexbsHF/nCiQrRn0Rerc6W5cKSCEQ3quSDwEsvnLnfvNjjqDuSQ9bQIE/ Zw5rYCibn27rPGZRyj4gkjSQitmXlO3miGx3lMPOuC1uaIlm112O8eFqOi6VYf5EodWw tisuNv8Dh4dlhvvQR11hkZzMTpRtPWO/Th2uMyw8cesKsOH3GVnBk5ei1kVtVC8Prqji eeLzJKyOY2/V9fDioAHHngqkS4b6KyFV6z2+Jz48SOP5ck0EvYQKS23DkPtThvc0pQJB C63HuUujoFTNN+wtQ1ASiYSoHITrKuOg9o+h9PaZfsZ3trkBVh4FfRUGuywALxnYcak3 R/aA== X-Gm-Message-State: AJaThX4RRt7VPNj8cH6w9ZnB+ppwetJAdQriCq4KwkvxIyFhSdpyvwf4 geSkoO6j85UNRf7wnff5IVQzkw== 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?= 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171204_060413_731275_EE11B489 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , stable@vger.kernel.org, Christoffer Dall , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;