linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix Oops in toshiba_acpi error return path
@ 2007-10-07 16:52 Andrey Borzenkov
  2007-10-07 18:54 ` Dmitry Torokhov
  2007-11-04 16:15 ` Andrey Borzenkov
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2007-10-07 16:52 UTC (permalink / raw)
  To: toshiba_acpi; +Cc: linux-acpi, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 142 bytes --]

This fixes oops when registering backlight device fails. Attached as I still 
cannot convince kmail to not mangle long lines ...

-andrey

[-- Attachment #1.2: toshiba_acpi-oops --]
[-- Type: text/x-diff, Size: 2099 bytes --]

Subject: [PATCH] Fix Oops in toshiba_acpi error return path
From: Andrey Borzenkov <arvidjaar@mail.ru>

When backlight_device_register() fails, return after undo initialization,
do not try to use pointer that just was reset to NULL

This fixes this oops:

[ 1595.177672]  [<c010480a>] show_trace_log_lvl+0x1a/0x30
[ 1595.177706]  [<c01052a2>] show_trace+0x12/0x20
[ 1595.177718]  [<c0105305>] dump_stack+0x15/0x20
[ 1595.177728]  [<c01c9375>] kobject_shadow_add+0x125/0x1c0
[ 1595.177754]  [<c01c941a>] kobject_add+0xa/0x10
[ 1595.177764]  [<c0239a37>] device_add+0x97/0x5d0
[ 1595.177776]  [<c0239f82>] device_register+0x12/0x20
[ 1595.177786]  [<dfd912df>] backlight_device_register+0x9f/0x110 [backlight]
[ 1595.177814]  [<df861117>] toshiba_acpi_init+0x117/0x15e [toshiba_acpi]
[ 1595.177834]  [<c013e28d>] sys_init_module+0xfd/0x14e0
[ 1595.177871]  [<c0104112>] sysenter_past_esp+0x5f/0x99
[ 1595.177883]  =======================
[ 1595.177890] Could not register toshiba backlight device
[ 1595.177985] BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004
...
[ 1595.394097] EIP:    0060:[<df861143>]    Not tainted VLI
[ 1595.394101] EFLAGS: 00010282   (2.6.23-rc9-1avb #24)
[ 1595.480081] EIP is at toshiba_acpi_init+0x143/0x15e [toshiba_acpi]

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>

---

 drivers/acpi/toshiba_acpi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 13369b4..18660cc 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -591,9 +591,12 @@ static int __init toshiba_acpi_init(void)
 						NULL,
 						&toshiba_backlight_data);
         if (IS_ERR(toshiba_backlight_device)) {
+		int ret = PTR_ERR(toshiba_backlight_device);
+
 		printk(KERN_ERR "Could not register toshiba backlight device\n");
 		toshiba_backlight_device = NULL;
 		toshiba_acpi_exit();
+		return ret;
 	}
         toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
 

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix Oops in toshiba_acpi error return path
  2007-10-07 16:52 [PATCH] Fix Oops in toshiba_acpi error return path Andrey Borzenkov
@ 2007-10-07 18:54 ` Dmitry Torokhov
  2007-11-04 16:15 ` Andrey Borzenkov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2007-10-07 18:54 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: toshiba_acpi, linux-acpi, linux-kernel

On Sunday 07 October 2007, Andrey Borzenkov wrote:
> This fixes oops when registering backlight device fails. Attached as I still 
> cannot convince kmail to not mangle long lines ...
> 
> -andrey
> 

Re: kmail - it usually behaves well with the patches as long as
you turn off word wrapping and use "Insert file..." to insert
them.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix Oops in toshiba_acpi error return path
  2007-10-07 16:52 [PATCH] Fix Oops in toshiba_acpi error return path Andrey Borzenkov
  2007-10-07 18:54 ` Dmitry Torokhov
@ 2007-11-04 16:15 ` Andrey Borzenkov
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2007-11-04 16:15 UTC (permalink / raw)
  To: toshiba_acpi; +Cc: linux-acpi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2276 bytes --]

On Sunday 07 October 2007, Andrey Borzenkov wrote:
> This fixes oops when registering backlight device fails. Attached as I
> still cannot convince kmail to not mangle long lines ...
>
> -andrey

ping ... 

Subject: [PATCH] Fix Oops in toshiba_acpi error return path

When backlight_device_register() fails, return after undo initialization,
do not try to use pointer that just was reset to NULL

This fixes this oops:

[ 1595.177672]  [<c010480a>] show_trace_log_lvl+0x1a/0x30
[ 1595.177706]  [<c01052a2>] show_trace+0x12/0x20
[ 1595.177718]  [<c0105305>] dump_stack+0x15/0x20
[ 1595.177728]  [<c01c9375>] kobject_shadow_add+0x125/0x1c0
[ 1595.177754]  [<c01c941a>] kobject_add+0xa/0x10
[ 1595.177764]  [<c0239a37>] device_add+0x97/0x5d0
[ 1595.177776]  [<c0239f82>] device_register+0x12/0x20
[ 1595.177786]  [<dfd912df>] backlight_device_register+0x9f/0x110 [backlight]
[ 1595.177814]  [<df861117>] toshiba_acpi_init+0x117/0x15e [toshiba_acpi]
[ 1595.177834]  [<c013e28d>] sys_init_module+0xfd/0x14e0
[ 1595.177871]  [<c0104112>] sysenter_past_esp+0x5f/0x99
[ 1595.177883]  =======================
[ 1595.177890] Could not register toshiba backlight device
[ 1595.177985] BUG: unable to handle kernel NULL pointer dereference at 
virtual address 00000004
...
[ 1595.394097] EIP:    0060:[<df861143>]    Not tainted VLI
[ 1595.394101] EFLAGS: 00010282   (2.6.23-rc9-1avb #24)
[ 1595.480081] EIP is at toshiba_acpi_init+0x143/0x15e [toshiba_acpi]

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>

---

 drivers/acpi/toshiba_acpi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 13369b4..18660cc 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -591,9 +591,12 @@ static int __init toshiba_acpi_init(void)
 						NULL,
 						&toshiba_backlight_data);
         if (IS_ERR(toshiba_backlight_device)) {
+		int ret = PTR_ERR(toshiba_backlight_device);
+
 		printk(KERN_ERR "Could not register toshiba backlight device\n");
 		toshiba_backlight_device = NULL;
 		toshiba_acpi_exit();
+		return ret;
 	}
         toshiba_backlight_device->props.max_brightness = 
HCI_LCD_BRIGHTNESS_LEVELS - 1;
 


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-04 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-07 16:52 [PATCH] Fix Oops in toshiba_acpi error return path Andrey Borzenkov
2007-10-07 18:54 ` Dmitry Torokhov
2007-11-04 16:15 ` Andrey Borzenkov

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).