linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Len Brown <len.brown@intel.com>
Cc: linux-kernel@vger.kernel.org,
	ibm-acpi-devel@lists.sourceforge.net,
	"René Treffer" <treffer@in.tum.de>,
	"Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>
Subject: [2.6.23 regression fix] fix thinkpad_acpi without hardware
Date: Sun, 5 Aug 2007 21:53:54 +0200	[thread overview]
Message-ID: <20070805195354.GF3972@stusta.de> (raw)

René Treffer reported that booting a CONFIG_THINKPAD_ACPI=y kernel on a 
machine without the hardware results in an Oops.

The trace is thinkpad_acpi_module_init -> thinkpad_acpi_module_exit -> 
driver_remove_file -> sysfs_hash_and_remove.

The error handling if thinkpad_acpi_module_init() fails generally looks 
suspicious, but this patch at least fixes the common case if no hardware 
was found, and it seems in this case there isn't any cleanup 
actually required.

Broken by commit d5a2f2f1d68e2da538ac28540cddd9ccc733b001.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---
bfa7bcd2b872f2c20afa7f7260d9be7dffe92d2e 
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index fa80f35..c7432a7 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -4644,10 +4644,8 @@ static int __init thinkpad_acpi_module_init(void)
 
 	get_thinkpad_model_data(&thinkpad_id);
 	ret = probe_for_thinkpad();
-	if (ret) {
-		thinkpad_acpi_module_exit();
+	if (ret)
 		return ret;
-	}
 
 	/* Driver initialization */
 


             reply	other threads:[~2007-08-05 19:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05 19:53 Adrian Bunk [this message]
2007-08-05 20:18 ` [2.6.23 regression fix] fix thinkpad_acpi without hardware Henrique de Moraes Holschuh

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=20070805195354.GF3972@stusta.de \
    --to=bunk@stusta.de \
    --cc=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=treffer@in.tum.de \
    /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;
as well as URLs for NNTP newsgroup(s).