From patchwork Thu Dec 1 07:41:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "majun \(F\)" X-Patchwork-Id: 85971 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp576529qgi; Wed, 30 Nov 2016 23:42:27 -0800 (PST) X-Received: by 10.99.96.85 with SMTP id u82mr67468476pgb.47.1480578147671; Wed, 30 Nov 2016 23:42:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b27si68244232pfe.274.2016.11.30.23.42.27; Wed, 30 Nov 2016 23:42:27 -0800 (PST) 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 S1758533AbcLAHm0 (ORCPT + 7 others); Thu, 1 Dec 2016 02:42:26 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:5752 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758528AbcLAHmZ (ORCPT ); Thu, 1 Dec 2016 02:42:25 -0500 Received: from 172.24.1.36 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.36]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DRN50868; Thu, 01 Dec 2016 15:41:56 +0800 (CST) Received: from localhost (10.177.249.226) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Thu, 1 Dec 2016 15:41:48 +0800 From: Majun To: , , , , , , , , , , CC: , , Subject: [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi Date: Thu, 1 Dec 2016 15:41:47 +0800 Message-ID: <1480578107-12512-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.249.226] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: MaJun 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 {