* [PATCH] Fix potential oops in dock driver
@ 2007-07-18 5:10 Dmitry Torokhov
2007-07-19 0:38 ` Len Brown
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2007-07-18 5:10 UTC (permalink / raw)
To: linux-acpi; +Cc: Kristen Carlson Accardi, Len Brown
Possible needed for -stable as well.
--
Dmitry
ACPI: dock - fix an oops when _DCK evaluation fails
Data returned by acpi_get_name in acpi_buffer is not acpi_object and
therefore should not be cast to it, otherwise we'll get an nice oops
trying to print error message.
Also print name of the ACPI object corresponding to the docking station
and elevate severity of the message printed when _DCK fails to KERN_ERR.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/acpi/dock.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux/drivers/acpi/dock.c
===================================================================
--- linux.orig/drivers/acpi/dock.c
+++ linux/drivers/acpi/dock.c
@@ -380,12 +380,11 @@ static void handle_dock(struct dock_stat
union acpi_object arg;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
- union acpi_object *obj;
acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer);
- obj = name_buffer.pointer;
- printk(KERN_INFO PREFIX "%s\n", dock ? "docking" : "undocking");
+ printk(KERN_INFO PREFIX "%s - %s\n",
+ (char *)name_buffer.pointer, dock ? "docking" : "undocking");
/* _DCK method has one argument */
arg_list.count = 1;
@@ -394,7 +393,8 @@ static void handle_dock(struct dock_stat
arg.integer.value = dock;
status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer);
if (ACPI_FAILURE(status))
- pr_debug("%s: failed to execute _DCK\n", obj->string.pointer);
+ printk(KERN_ERR PREFIX "%s - failed to execute _DCK\n",
+ (char *)name_buffer.pointer);
kfree(buffer.pointer);
kfree(name_buffer.pointer);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix potential oops in dock driver
2007-07-18 5:10 [PATCH] Fix potential oops in dock driver Dmitry Torokhov
@ 2007-07-19 0:38 ` Len Brown
0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2007-07-19 0:38 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-acpi, Kristen Carlson Accardi
Applied.
thanks,
-Len
On Wednesday 18 July 2007 01:10, Dmitry Torokhov wrote:
> [PATCH] Fix potential oops in dock driver
> From:
> Dmitry Torokhov <dtor@insightbb.com>
> To:
> linux-acpi@vger.kernel.org
> CC:
> Kristen Carlson Accardi <kristen.c.accardi@intel.com>, Len Brown <len.brown@intel.com>
> Date:
> Today 01:10:24 am
>
> Spam Status: Spamassassin 0% probability of being spam.
>
> Full report:
> No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.9
> Possible needed for -stable as well.
>
> --
> Dmitry
>
> ACPI: dock - fix an oops when _DCK evaluation fails
>
> Data returned by acpi_get_name in acpi_buffer is not acpi_object and
> therefore should not be cast to it, otherwise we'll get an nice oops
> trying to print error message.
>
> Also print name of the ACPI object corresponding to the docking station
> and elevate severity of the message printed when _DCK fails to KERN_ERR.
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> drivers/acpi/dock.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> Index: linux/drivers/acpi/dock.c
> ===================================================================
> --- linux.orig/drivers/acpi/dock.c
> +++ linux/drivers/acpi/dock.c
> @@ -380,12 +380,11 @@ static void handle_dock(struct dock_stat
> union acpi_object arg;
> struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
> struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
> - union acpi_object *obj;
>
> acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer);
> - obj = name_buffer.pointer;
>
> - printk(KERN_INFO PREFIX "%s\n", dock ? "docking" : "undocking");
> + printk(KERN_INFO PREFIX "%s - %s\n",
> + (char *)name_buffer.pointer, dock ? "docking" : "undocking");
>
> /* _DCK method has one argument */
> arg_list.count = 1;
> @@ -394,7 +393,8 @@ static void handle_dock(struct dock_stat
> arg.integer.value = dock;
> status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer);
> if (ACPI_FAILURE(status))
> - pr_debug("%s: failed to execute _DCK\n", obj->string.pointer);
> + printk(KERN_ERR PREFIX "%s - failed to execute _DCK\n",
> + (char *)name_buffer.pointer);
> kfree(buffer.pointer);
> kfree(name_buffer.pointer);
> }
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-19 0:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18 5:10 [PATCH] Fix potential oops in dock driver Dmitry Torokhov
2007-07-19 0:38 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox