From patchwork Wed Oct 12 01:20:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "majun \(F\)" X-Patchwork-Id: 77524 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp251869qge; Tue, 11 Oct 2016 18:20:58 -0700 (PDT) X-Received: by 10.99.119.72 with SMTP id s69mr5317680pgc.11.1476235258519; Tue, 11 Oct 2016 18:20:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si3014650pgj.165.2016.10.11.18.20.57; Tue, 11 Oct 2016 18:20:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752030AbcJLBU4 (ORCPT + 7 others); Tue, 11 Oct 2016 21:20:56 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:29096 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbcJLBU4 (ORCPT ); Tue, 11 Oct 2016 21:20:56 -0400 Received: from 172.24.1.36 (EHLO szxeml434-hub.china.huawei.com) ([172.24.1.36]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CJD02840; Wed, 12 Oct 2016 09:20:33 +0800 (CST) Received: from localhost (10.177.235.245) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.235.1; Wed, 12 Oct 2016 09:20:23 +0800 From: MaJun To: , , , , CC: , , Subject: [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi Date: Wed, 12 Oct 2016 09:20:56 +0800 Message-ID: <1476235256-10744-1-git-send-email-majun258@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.177.235.245] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The return value 0 from acpi_register_gsi() means irq mapping failed. So, we should process this case in else branch. Signed-off-by: MaJun --- drivers/acpi/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.12.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 56241eb..9918326 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -416,7 +416,7 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, res->flags = acpi_dev_irq_flags(triggering, polarity, shareable); irq = acpi_register_gsi(NULL, gsi, triggering, polarity); - if (irq >= 0) { + if (irq > 0) { res->start = irq; res->end = irq; } else {