From: Chris Wright <chrisw@osdl.org>
To: Karsten Wiese <annabellesgarden@yahoo.de>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
len.brown@intel.com, borislav@users.sourceforge.net
Subject: Re: 2.6.10-rc1-mm3
Date: Mon, 8 Nov 2004 15:30:22 -0800 [thread overview]
Message-ID: <20041108153022.N14339@build.pdx.osdl.net> (raw)
In-Reply-To: <200411082240.02787.annabellesgarden@yahoo.de>; from annabellesgarden@yahoo.de on Mon, Nov 08, 2004 at 10:40:02PM +0100
* Karsten Wiese (annabellesgarden@yahoo.de) wrote:
> Found out, what happened:
> By accident I had ibm_acpi.ko built. Its name "ibm" was still present under "/proc/acpi".
> This is not an ibm(-laptop)-machine, so ibm_acpi.ko is useless here.
> "Unable to handle kernel paging request at virtual address f89e7b00":
> this address corresponds to the "struct module *" of ibm_acpi.ko, which was not loaded anymore.
> So the real bug here is that there is a non NULL "struct module *", where the corresponding module is unloaded.
> Or so I guess.....
The init error cleanup paths are broken in that driver. It creates the
/proc/acpi/ibm dir and forgets to clean it up. Partially that's due to
returning directly from the macro IBM_HANDLE_INIT_REQ. This should help.
Signed-off-by: Chris Wright <chrisw@osdl.org>
--- linux-2.6.10-rc1-mm3/drivers/acpi/ibm_acpi.c~orig 2004-11-05 15:18:51.000000000 -0800
+++ linux-2.6.10-rc1-mm3/drivers/acpi/ibm_acpi.c 2004-11-08 15:14:20.000000000 -0800
@@ -1129,22 +1129,18 @@
if (ACPI_SUCCESS(status))
return 0;
}
-
- if (required) {
- printk(IBM_ERR "%s object not found\n", name);
- return -1;
- }
*handle = NULL;
+ if (required)
+ printk(IBM_ERR "%s object not found\n", name);
+
return 0;
}
-#define IBM_HANDLE_INIT_REQ(object) do { \
- if (ibm_handle_init(#object, &object##_handle, *object##_parent, \
- object##_paths, sizeof(object##_paths)/sizeof(char *), 1) < 0)\
- return -ENODEV; \
-} while (0)
+#define IBM_HANDLE_INIT_REQ(object) \
+ ibm_handle_init(#object, &object##_handle, *object##_parent, \
+ object##_paths, sizeof(object##_paths)/sizeof(char *), 1)
#define IBM_HANDLE_INIT(object) \
ibm_handle_init(#object, &object##_handle, *object##_parent, \
@@ -1179,46 +1175,56 @@
static int __init acpi_ibm_init(void)
{
- int ret, i;
+ int i, ret = -ENODEV;
if (acpi_disabled)
- return -ENODEV;
+ return ret;
proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir);
if (!proc_dir) {
printk(IBM_ERR "unable to create proc dir %s", IBM_DIR);
- return -ENODEV;
+ return ret;
}
proc_dir->owner = THIS_MODULE;
- IBM_HANDLE_INIT_REQ(ec);
- IBM_HANDLE_INIT_REQ(hkey);
- IBM_HANDLE_INIT_REQ(vid);
+ IBM_HANDLE_INIT(ec);
+ if (!ec_handle)
+ goto cleanup;
+
+ IBM_HANDLE_INIT(hkey);
+ if (!hkey_handle)
+ goto cleanup;
+
+ IBM_HANDLE_INIT(vid);
+ if (!vid_handle)
+ goto cleanup;
+
IBM_HANDLE_INIT(cmos);
IBM_HANDLE_INIT(lght);
+ if (!cmos_handle && !lght_handle) {
+ printk(IBM_ERR "neither cmos nor lght object found\n");
+ goto cleanup;
+ }
+
IBM_HANDLE_INIT(dock);
IBM_HANDLE_INIT(bay);
IBM_HANDLE_INIT(bayej);
IBM_HANDLE_INIT(led);
+
IBM_HANDLE_INIT(sysl);
IBM_HANDLE_INIT(bled);
- IBM_HANDLE_INIT_REQ(beep);
-
- if (!cmos_handle && !lght_handle) {
- printk(IBM_ERR "neither cmos nor lght object found\n");
- return -ENODEV;
- }
-
if (!led_handle && !sysl_handle) {
printk(IBM_ERR "neither led nor sysl object found\n");
- return -ENODEV;
+ goto cleanup;
}
+ IBM_HANDLE_INIT_REQ(beep);
+ if (!beep_handle)
+ goto cleanup;
for (i=0; i<NUM_IBMS; i++) {
ret = ibm_init(&ibms[i]);
if (ret < 0) {
- acpi_ibm_exit();
- return ret;
+ goto cleanup;
}
}
@@ -1233,6 +1239,9 @@
IBM_PARAM(beep);
return 0;
+cleanup:
+ acpi_ibm_exit();
+ return ret;
}
module_init(acpi_ibm_init);
next prev parent reply other threads:[~2004-11-08 23:31 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-08 12:34 2.6.10-rc1-mm3 Karsten Wiese
2004-11-08 21:40 ` 2.6.10-rc1-mm3 Karsten Wiese
2004-11-08 22:25 ` 2.6.10-rc1-mm3 linux-os
2004-11-08 23:30 ` Chris Wright [this message]
2004-11-09 1:30 ` [PATCH] ibm-acpi-0.8 (was Re: 2.6.10-rc1-mm3) Borislav Deianov
2004-11-09 2:12 ` Chris Wright
2004-11-09 2:31 ` Borislav Deianov
2004-11-29 0:34 ` Rusty Russell
2004-11-09 6:31 ` Len Brown
-- strict thread matches above, loose matches on Subject: below --
2004-11-06 19:04 2.6.10-rc1-mm3 Paul Blazejowski
2004-11-07 10:48 ` 2.6.10-rc1-mm3 Andrew Morton
2004-11-07 17:24 ` 2.6.10-rc1-mm3 Paul Blazejowski
2004-11-08 7:59 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-08 7:42 ` 2.6.10-rc1-mm3 Andrew Morton
2004-11-08 22:42 ` 2.6.10-rc1-mm3 Greg KH
2004-11-09 5:27 ` 2.6.10-rc1-mm3 Andrew Morton
2004-11-09 7:14 ` 2.6.10-rc1-mm3 Greg KH
2004-11-09 8:05 ` 2.6.10-rc1-mm3 Greg KH
2004-11-09 8:15 ` 2.6.10-rc1-mm3 Andrew Morton
2004-11-09 8:27 ` 2.6.10-rc1-mm3 Greg KH
2004-11-09 12:11 ` 2.6.10-rc1-mm3 Tejun Heo
2004-11-09 7:53 ` 2.6.10-rc1-mm3 Olivier Poitrey
2004-11-09 8:22 ` 2.6.10-rc1-mm3 Arjan van de Ven
2004-11-09 9:25 ` 2.6.10-rc1-mm3 Olivier Poitrey
2004-11-09 10:37 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-09 9:39 ` 2.6.10-rc1-mm3 Andrew Morton
2004-11-09 10:44 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-09 10:33 ` 2.6.10-rc1-mm3 Andries Brouwer
2004-11-11 1:52 ` 2.6.10-rc1-mm3 H. Peter Anvin
2004-11-09 18:24 ` 2.6.10-rc1-mm3 Paul Blazejowski
[not found] <20041105001328.3ba97e08.akpm@osdl.org.suse.lists.linux.kernel>
[not found] ` <418B5C70.7090206@kolivas.org.suse.lists.linux.kernel>
2004-11-05 11:53 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 12:16 ` 2.6.10-rc1-mm3 Con Kolivas
2004-11-05 12:23 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 8:13 2.6.10-rc1-mm3 Andrew Morton
2004-11-05 9:41 ` 2.6.10-rc1-mm3 Lorenzo Allegrucci
2004-11-05 10:17 ` 2.6.10-rc1-mm3 Andrew Morton
2004-11-05 10:48 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 12:36 ` 2.6.10-rc1-mm3 Lorenzo Allegrucci
2004-11-05 10:22 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-05 10:38 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 11:09 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-05 11:17 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 11:24 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-05 11:43 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 12:15 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-05 12:22 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 12:57 ` 2.6.10-rc1-mm3 Rafael J. Wysocki
2004-11-05 13:02 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 17:47 ` 2.6.10-rc1-mm3 Rafael J. Wysocki
2004-11-05 11:20 ` 2.6.10-rc1-mm3 Russell King
2004-11-05 11:30 ` 2.6.10-rc1-mm3 Andi Kleen
2004-11-05 10:17 ` 2.6.10-rc1-mm3 Ingo Molnar
2004-11-05 15:54 ` 2.6.10-rc1-mm3 Michael Baehr
2004-11-05 10:56 ` 2.6.10-rc1-mm3 Con Kolivas
2004-11-05 18:07 ` 2.6.10-rc1-mm3 Rafael J. Wysocki
2004-11-05 18:07 ` 2.6.10-rc1-mm3 Adam Heath
2004-11-06 7:16 ` 2.6.10-rc1-mm3 Pasi Savolainen
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=20041108153022.N14339@build.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=annabellesgarden@yahoo.de \
--cc=borislav@users.sourceforge.net \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®