diff mbox

[2/2] ACPI: fix broken usage of acpi_ut_get_node_name()

Message ID 1235486898-27756-2-git-send-email-hmh@hmh.eng.br (mailing list archive)
State Accepted, archived
Delegated to: Len Brown
Headers show

Commit Message

Henrique de Moraes Holschuh Feb. 24, 2009, 2:48 p.m. UTC
acpi_ut_get_node_name() returns a four char fixed-size array, not
NULL-terminated.

This issue was fixed indirectly in mainline by commit
60a4ce7f4148155d3f28eea4a213f7ee47cd57b7.

This is the minimal fix for stable 2.6.28.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: stable@kernel.org
Cc: Lin Ming <ming.m.lin@intel.com>
---
 drivers/acpi/power.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Henrique de Moraes Holschuh March 5, 2009, 1:40 a.m. UTC | #1
PING...

This is a cosmetic fix, but it still avoids random binary crap leaking
into debug messages, for the price of an obvious 3-char change.

Can I get an ACK for it, please?  I'd like to see this go into
2.6.28.y...

On Tue, 24 Feb 2009, Henrique de Moraes Holschuh wrote:
> acpi_ut_get_node_name() returns a four char fixed-size array, not
> NULL-terminated.
> 
> This issue was fixed indirectly in mainline by commit
> 60a4ce7f4148155d3f28eea4a213f7ee47cd57b7.
> 
> This is the minimal fix for stable 2.6.28.
> 
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Cc: stable@kernel.org
> Cc: Lin Ming <ming.m.lin@intel.com>
> ---
>  drivers/acpi/power.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
> index bb7d50d..ad55db1 100644
> --- a/drivers/acpi/power.c
> +++ b/drivers/acpi/power.c
> @@ -151,7 +151,7 @@ static int acpi_power_get_state(acpi_handle handle, int *state)
>  	*state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
>  			      ACPI_POWER_RESOURCE_STATE_OFF;
>  
> -	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
> +	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%4.4s] is %s\n",
>  			  acpi_ut_get_node_name(handle),
>  				*state ? "on" : "off"));
>
Lin Ming March 5, 2009, 1:56 a.m. UTC | #2
On Thu, 2009-03-05 at 09:40 +0800, Henrique de Moraes Holschuh wrote:
> PING...
> 
> This is a cosmetic fix, but it still avoids random binary crap leaking
> into debug messages, for the price of an obvious 3-char change.
> 
> Can I get an ACK for it, please?  I'd like to see this go into
> 2.6.28.y...

Looks good.

Ack-by: Lin Ming <ming.m.lin@intel.com>

> 
> On Tue, 24 Feb 2009, Henrique de Moraes Holschuh wrote:
> > acpi_ut_get_node_name() returns a four char fixed-size array, not
> > NULL-terminated.
> > 
> > This issue was fixed indirectly in mainline by commit
> > 60a4ce7f4148155d3f28eea4a213f7ee47cd57b7.
> > 
> > This is the minimal fix for stable 2.6.28.
> > 
> > Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> > Cc: stable@kernel.org
> > Cc: Lin Ming <ming.m.lin@intel.com>
> > ---
> >  drivers/acpi/power.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
> > index bb7d50d..ad55db1 100644
> > --- a/drivers/acpi/power.c
> > +++ b/drivers/acpi/power.c
> > @@ -151,7 +151,7 @@ static int acpi_power_get_state(acpi_handle handle, int *state)
> >  	*state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
> >  			      ACPI_POWER_RESOURCE_STATE_OFF;
> >  
> > -	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
> > +	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%4.4s] is %s\n",
> >  			  acpi_ut_get_node_name(handle),
> >  				*state ? "on" : "off"));
> >  
> 

--
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
diff mbox

Patch

diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index bb7d50d..ad55db1 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -151,7 +151,7 @@  static int acpi_power_get_state(acpi_handle handle, int *state)
 	*state = (sta & 0x01)?ACPI_POWER_RESOURCE_STATE_ON:
 			      ACPI_POWER_RESOURCE_STATE_OFF;
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%4.4s] is %s\n",
 			  acpi_ut_get_node_name(handle),
 				*state ? "on" : "off"));