From patchwork Fri Jan 9 20:17:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 1622 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n09KEVbo012930 for ; Fri, 9 Jan 2009 12:14:36 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755123AbZAIUSU (ORCPT ); Fri, 9 Jan 2009 15:18:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755263AbZAIUSU (ORCPT ); Fri, 9 Jan 2009 15:18:20 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:52434 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755044AbZAIUSS (ORCPT ); Fri, 9 Jan 2009 15:18:18 -0500 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n09KHEIx021389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Jan 2009 12:17:15 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id n09KHEqd015005; Fri, 9 Jan 2009 12:17:14 -0800 Message-Id: <200901092017.n09KHEqd015005@imap1.linux-foundation.org> Subject: [patch 6/6] acpi dock: terminate eject request is the dock is not present To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org, marvin@mydatex.cz, hmacht@suse.de, rui.zhang@intel.com, shaohua.li@intel.com, stable@kernel.org From: akpm@linux-foundation.org Date: Fri, 09 Jan 2009 12:17:13 -0800 X-Spam-Status: No, hits=-3.411 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Daniel Smolik Taken from http://bugzilla.kernel.org/show_bug.cgi?id=12360 nfi if it's right - I merged it so it wouldn't get lost. Cc: Zhang Rui Cc: Len Brown Cc: "Li, Shaohua" Cc: Cc: [2.6.26.x, 2.6.27.x, 2.6.28.x] Signed-off-by: Andrew Morton --- drivers/acpi/dock.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN drivers/acpi/dock.c~acpi-dock-terminate-eject-request-is-the-dock-is-not-present drivers/acpi/dock.c --- a/drivers/acpi/dock.c~acpi-dock-terminate-eject-request-is-the-dock-is-not-present +++ a/drivers/acpi/dock.c @@ -668,6 +668,9 @@ EXPORT_SYMBOL_GPL(unregister_hotplug_doc */ static int handle_eject_request(struct dock_station *ds, u32 event) { + if (!dock_present(ds)) + return -ENODEV; + if (dock_in_progress(ds)) return -EBUSY;