From patchwork Thu May 19 16:51:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 9127971 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 177FC60221 for ; Thu, 19 May 2016 16:51:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AD78281CE for ; Thu, 19 May 2016 16:51:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3F3A281D3; Thu, 19 May 2016 16:51:44 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27A11281CE for ; Thu, 19 May 2016 16:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755209AbcESQvl (ORCPT ); Thu, 19 May 2016 12:51:41 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:47785 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755208AbcESQvl (ORCPT ); Thu, 19 May 2016 12:51:41 -0400 Received: from nwb-ext-pat.microfocus.com ([10.120.13.103]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 19 May 2016 18:51:38 +0200 Received: from linux-gy6r.site (nwb-a10-snat.microfocus.com [10.120.13.202]) by nwb-ext-pat.microfocus.com with ESMTP (TLS encrypted); Thu, 19 May 2016 17:51:14 +0100 From: Matthias Brugger To: rjw@rjwysocki.net Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Brugger Subject: [PATCH] ACPI / tables: Return error from table parse handler Date: Thu, 19 May 2016 18:51:07 +0200 Message-Id: <1463676667-17945-1-git-send-email-mbrugger@suse.com> X-Mailer: git-send-email 2.6.6 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The handler called in acpi_table_parse may return an error. This patch returns this error instead of ignoring it. Signed-off-by: Matthias Brugger --- drivers/acpi/tables.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index a372f9e..fb5cd80 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -394,6 +394,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler) { struct acpi_table_header *table = NULL; acpi_size tbl_size; + int ret; if (acpi_disabled) return -ENODEV; @@ -407,9 +408,9 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler) acpi_get_table_with_size(id, 0, &table, &tbl_size); if (table) { - handler(table); + ret = handler(table); early_acpi_os_unmap_memory(table, tbl_size); - return 0; + return ret; } else return -ENODEV; }