Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752291AbZL3GTj (ORCPT ); Wed, 30 Dec 2009 01:19:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752162AbZL3GTi (ORCPT ); Wed, 30 Dec 2009 01:19:38 -0500 Received: from vms173015pub.verizon.net ([206.46.173.15]:49092 "EHLO vms173015pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751989AbZL3GTi (ORCPT ); Wed, 30 Dec 2009 01:19:38 -0500 Date: Wed, 30 Dec 2009 01:19:12 -0500 (EST) From: Len Brown X-X-Sender: lenb@localhost.localdomain To: Paul Rolland Cc: Ingo Molnar , Linus Torvalds , Dmitry Torokhov , Matthew Garrett , Linux Kernel Mailing List , rol@witbe.net, werner , linux-acpi@vger.kernel.org Subject: [PATCH] wmi: check find_guid() return value to prevent oops In-reply-to: <20091228175301.4e89aa65@tux.DEF.witbe.net> Message-id: References: <20091225102731.GA25513@elte.hu> <20091228094444.GG24690@elte.hu> <20091228120125.GA10911@elte.hu> <20091228160212.1f70d825@tux.DEF.witbe.net> <20091228175301.4e89aa65@tux.DEF.witbe.net> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 40 From: rol@as2917.net Signed-off-by: rol@as2917.net Signed-off-by: Len Brown --- drivers/platform/x86/wmi.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 9f93d6c..cc9ad74 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -492,8 +492,7 @@ wmi_notify_handler handler, void *data) if (!guid || !handler) return AE_BAD_PARAMETER; - find_guid(guid, &block); - if (!block) + if (!find_guid(guid, &block)) return AE_NOT_EXIST; if (block->handler) @@ -521,8 +520,7 @@ acpi_status wmi_remove_notify_handler(const char *guid) if (!guid) return AE_BAD_PARAMETER; - find_guid(guid, &block); - if (!block) + if (!find_guid(guid, &block)) return AE_NOT_EXIST; if (!block->handler) -- 1.6.6.rc4.11.g129a5 -- 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/