Linux ACPI
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Paul Rolland <rol@as2917.net>
Cc: Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Matthew Garrett <mjg@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	rol@witbe.net, werner <w.landgraf@ru.ru>,
	linux-acpi@vger.kernel.org
Subject: [PATCH] wmi: check find_guid() return value to prevent oops
Date: Wed, 30 Dec 2009 01:19:12 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0912300116430.15839@localhost.localdomain> (raw)
In-Reply-To: <20091228175301.4e89aa65@tux.DEF.witbe.net>

From: rol@as2917.net <Paul Rolland>

Signed-off-by: rol@as2917.net <Paul Rolland>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 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


       reply	other threads:[~2009-12-30  6:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LFD.2.00.0912241350510.11961@localhost.localdomain>
     [not found] ` <20091225102731.GA25513@elte.hu>
     [not found]   ` <alpine.LFD.2.00.0912261504460.4089@localhost.localdomain>
     [not found]     ` <alpine.LFD.2.00.0912262316530.14053@localhost.localdomain>
     [not found]       ` <20091228094444.GG24690@elte.hu>
     [not found]         ` <20091228120125.GA10911@elte.hu>
     [not found]           ` <20091228160212.1f70d825@tux.DEF.witbe.net>
     [not found]             ` <20091228175301.4e89aa65@tux.DEF.witbe.net>
2009-12-30  6:19               ` Len Brown [this message]
2009-12-30  6:21               ` [PATCH] dell-wmi: sys_init_module: 'dell_wmi'->init suspiciously returned 21, it should follow 0/-E convention Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0912300116430.15839@localhost.localdomain \
    --to=lenb@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mjg@redhat.com \
    --cc=rol@as2917.net \
    --cc=rol@witbe.net \
    --cc=torvalds@linux-foundation.org \
    --cc=w.landgraf@ru.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox