Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756074AbaKROYM (ORCPT ); Tue, 18 Nov 2014 09:24:12 -0500 Received: from www.linutronix.de ([62.245.132.108]:39344 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754556AbaKROYJ (ORCPT ); Tue, 18 Nov 2014 09:24:09 -0500 Date: Tue, 18 Nov 2014 15:24:02 +0100 (CET) From: Thomas Gleixner To: "Yun Wu (Abel)" cc: Jiang Liu , LKML , Bjorn Helgaas , Grant Likely , Marc Zyngier , Yingjoe Chen , Yijing Wang Subject: Re: [patch 09/16] genirq: Add generic msi irq domain support In-Reply-To: <546B4FC5.1050209@huawei.com> Message-ID: References: <20141112133941.647950773@linutronix.de> <20141112134120.569789374@linutronix.de> <546B3667.9040506@huawei.com> <546B4075.9050406@linux.intel.com> <546B4FC5.1050209@huawei.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Nov 2014, Yun Wu (Abel) wrote: > On 2014/11/18 20:49, Jiang Liu wrote: > >>> + ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg); > >>> + if (ret < 0) > >>> + return ret; > >>> + > >>> + for (i = 0; i < nr_irqs; i++) { > >>> + ret = ops->msi_init(domain, info, virq + i, hwirq + i, arg); > >>> + if (ret < 0) { > >>> + if (ops->msi_free) { > >>> + for (i--; i > 0; i--) > >> > >> while (i--) ? The allocation for 'i' failed. So we don't free i. You missed the real bug here: > >>> + for (i--; i > 0; i--) Must be i >= 0. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/