Received: by 10.223.185.116 with SMTP id b49csp4052338wrg; Mon, 26 Feb 2018 10:16:56 -0800 (PST) X-Google-Smtp-Source: AH8x225iGNqG3oyVyaQ1Fa97oefQ3SeSDSkJCvuqi9DRayFAYHXqmGzwkPya/APdyEy/7cxJRshd X-Received: by 10.98.196.199 with SMTP id h68mr11354744pfk.42.1519669016277; Mon, 26 Feb 2018 10:16:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519669016; cv=none; d=google.com; s=arc-20160816; b=vqoe3AykOCrg2+y/jn8jKWJZDWjAtahormBNHEqjqcRYL/UZRIsdEB/3hh6ncfgP5C lrhiz0e6M8iWvIm92/xPnLeT5ZbSeaIZaJ0x91x/UBxB0M3pxTZHLu62B51LaM9AgRb2 bKygXpRvfKZ+QrtDQD7lcou1KkBTOEpfurwkxix61IZvjy/KESXiyCTQ/FqZsBAjkxs4 fFjmsNMj4Q8LY1fglJ/vxXFP/k4ITAXXxBVwI+/lNs0oZLw+hp5WTDUFEIJGa0QNFr1y 7RN4wsE8qW1Q7REIT8wLJEjcHhdKtax/7Dj7i11Sbrk4UV/H9I/+7JvcPSAGYq9aCLQw LgXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=58k8gfqa3AFkHngLcRyeiGfm2+H5+C6XTX7Lwi/C5+8=; b=kSda6fZ/N4g4PxZakNMIFUppIvbnqy3VnYBcv/y0x96+5/UswxuOsgrLJbt+XBZCA/ tM2j9jmBLCHiFOG6Sm/MHZbUfny+WP0MBkv55JPzCNmYk9Iv1mQZ6BroyXHZnKVjTHxn oP5lk+OuRAcWWX1gZHOZkpXQOuEoDG5Q+ZSYjfYPzKwkC9MkR1q4qVONeVyQzxVCpRDz hZ56V1hHc23Q1IE+WocQl9D2N4TFVn3TnvOBlMTyhVS4/ReXLv4SKLBXrn3efKyRvx/q AU0bITVAuXd40+AohKml1fquoaEMq4nJz5F6n/eMAaAzDspsLu5qivkNzErHY++X8AL3 iCbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si7104549plm.539.2018.02.26.10.16.40; Mon, 26 Feb 2018 10:16:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751472AbeBZSP7 (ORCPT + 99 others); Mon, 26 Feb 2018 13:15:59 -0500 Received: from smtp.ctxuk.citrix.com ([185.25.65.24]:9166 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbeBZSP6 (ORCPT ); Mon, 26 Feb 2018 13:15:58 -0500 X-IronPort-AV: E=Sophos;i="5.47,397,1515456000"; d="scan'208";a="68626333" Date: Mon, 26 Feb 2018 18:14:39 +0000 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Amit Shah CC: , , , David Vrabel , Boris Ostrovsky , Eduardo Valentin , Juergen Gross , Thomas Gleixner , "K. Y. Srinivasan" , Liu Shuo , Anoob Soman Subject: Re: [PATCH 2/2] xen: events: free irqs in error condition Message-ID: <20180226181439.zbdtzbv7wifjst2l@MacBook-Pro-de-Roger.local> References: <1519666595-41362-1-git-send-email-aams@amazon.com> <1519666595-41362-3-git-send-email-aams@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1519666595-41362-3-git-send-email-aams@amazon.com> User-Agent: NeoMutt/20171215 X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 26, 2018 at 05:36:35PM +0000, Amit Shah wrote: > In case of errors in irq setup for MSI, free up the allocated irqs. > > Fixes: 4892c9b4ada9f9 ("xen: add support for MSI message groups") > Reported-by: Hooman Mirhadi > CC: > CC: Roger Pau Monn? > CC: David Vrabel > CC: Boris Ostrovsky > CC: Eduardo Valentin > CC: Juergen Gross > CC: Thomas Gleixner > CC: "K. Y. Srinivasan" > CC: Liu Shuo > CC: Anoob Soman > Signed-off-by: Amit Shah > --- > drivers/xen/events/events_base.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c > index b6b8b29..96aa575 100644 > --- a/drivers/xen/events/events_base.c > +++ b/drivers/xen/events/events_base.c > @@ -758,6 +758,7 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, > error_irq: > for (; i >= 0; i--) > __unbind_from_irq(irq + i); > + xen_free_irq(irq); Hm, xen_free_irq calls irq_free_desc, which is irq_free_descs(irq, 1), I think you will have to introduce a new free function: xen_free_irqs(unsigned irq, unsigned int nr) That calls irq_free_descs(irq, nr) Thanks, Roger.