Re: [PATCH] Fix segfault when printing battery status

2007-11-26 Thread Andrew Morton
On Mon, 19 Nov 2007 14:09:51 +0300
Alexey Starikovskiy <[EMAIL PROTECTED]> wrote:

> Rolf Eike Beer wrote:
> > Alexey Starikovskiy wrote:
> >   
> >> Rolf Eike Beer wrote:
> >> 
> >>> cat
> >>> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_
> >>> supply/BAT1/status
> >>>
> >>> This leads to a stacktrace as acpi_battery_get_property() returns 0 for a
> >>> case where it does not set val->intval. These value is used as an array
> >>> index in
> >>> drivers/power/power_supply_sysfs.c::power_supply_show_property(). I had a
> >>> situation where the value was 4096 which caused a problem as the array
> >>> only has 5 entries.
> >>>
> >>> Signed-off-by: Rolf Eike Beer <[EMAIL PROTECTED]>
> >>>   
> >> Rolf, thanks for remainding.
> >> 
> >
> > Huh? This one is unrelated to the problem I reported two weeks ago...
> >
> > Eike
> >   
> You are second to send the same patch, first one I already acked.
> But it seems that Len did not pick it up yet.
> Look for "ACPI: Always return valid 'status' from 
> acpi_battery_get_property()"
> if interested...
> 

This fix is in Len's tree and was in his 2.6.24-rc3 pull request to
Linus.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix segfault when printing battery status

2007-11-26 Thread Andrew Morton
On Mon, 19 Nov 2007 14:09:51 +0300
Alexey Starikovskiy [EMAIL PROTECTED] wrote:

 Rolf Eike Beer wrote:
  Alexey Starikovskiy wrote:

  Rolf Eike Beer wrote:
  
  cat
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_
  supply/BAT1/status
 
  This leads to a stacktrace as acpi_battery_get_property() returns 0 for a
  case where it does not set val-intval. These value is used as an array
  index in
  drivers/power/power_supply_sysfs.c::power_supply_show_property(). I had a
  situation where the value was 4096 which caused a problem as the array
  only has 5 entries.
 
  Signed-off-by: Rolf Eike Beer [EMAIL PROTECTED]

  Rolf, thanks for remainding.
  
 
  Huh? This one is unrelated to the problem I reported two weeks ago...
 
  Eike

 You are second to send the same patch, first one I already acked.
 But it seems that Len did not pick it up yet.
 Look for ACPI: Always return valid 'status' from 
 acpi_battery_get_property()
 if interested...
 

This fix is in Len's tree and was in his 2.6.24-rc3 pull request to
Linus.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix segfault when printing battery status

2007-11-19 Thread Alexey Starikovskiy

Rolf Eike Beer wrote:

Alexey Starikovskiy wrote:
  

Rolf Eike Beer wrote:


cat
/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_
supply/BAT1/status

This leads to a stacktrace as acpi_battery_get_property() returns 0 for a
case where it does not set val->intval. These value is used as an array
index in
drivers/power/power_supply_sysfs.c::power_supply_show_property(). I had a
situation where the value was 4096 which caused a problem as the array
only has 5 entries.

Signed-off-by: Rolf Eike Beer <[EMAIL PROTECTED]>
  

Rolf, thanks for remainding.



Huh? This one is unrelated to the problem I reported two weeks ago...

Eike
  

You are second to send the same patch, first one I already acked.
But it seems that Len did not pick it up yet.
Look for "ACPI: Always return valid 'status' from 
acpi_battery_get_property()"

if interested...

Regards,
Alex.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix segfault when printing battery status

2007-11-19 Thread Rolf Eike Beer
Alexey Starikovskiy wrote:
> Rolf Eike Beer wrote:
> > cat
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_
> >supply/BAT1/status
> >
> > This leads to a stacktrace as acpi_battery_get_property() returns 0 for a
> > case where it does not set val->intval. These value is used as an array
> > index in
> > drivers/power/power_supply_sysfs.c::power_supply_show_property(). I had a
> > situation where the value was 4096 which caused a problem as the array
> > only has 5 entries.
> >
> > Signed-off-by: Rolf Eike Beer <[EMAIL PROTECTED]>
>
> Rolf, thanks for remainding.

Huh? This one is unrelated to the problem I reported two weeks ago...

Eike


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] Fix segfault when printing battery status

2007-11-19 Thread Alexey Starikovskiy


Rolf Eike Beer wrote:

cat 
/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_supply/BAT1/status

This leads to a stacktrace as acpi_battery_get_property() returns 0 for a 
case where it does not set val->intval. These value is used as an array 
index in drivers/power/power_supply_sysfs.c::power_supply_show_property(). 
I had a situation where the value was 4096 which caused a problem as the 
array only has 5 entries.


Signed-off-by: Rolf Eike Beer <[EMAIL PROTECTED]>
  

Rolf, thanks for remainding.
Acked again,
Alex.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix segfault when printing battery status

2007-11-19 Thread Rolf Eike Beer
cat 
/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_supply/BAT1/status

This leads to a stacktrace as acpi_battery_get_property() returns 0 for a 
case where it does not set val->intval. These value is used as an array 
index in drivers/power/power_supply_sysfs.c::power_supply_show_property(). 
I had a situation where the value was 4096 which caused a problem as the 
array only has 5 entries.

Signed-off-by: Rolf Eike Beer <[EMAIL PROTECTED]>

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 192c244..2e8e790 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -153,6 +153,8 @@ static int acpi_battery_get_property(struct power_supply 
*psy,
val->intval = POWER_SUPPLY_STATUS_CHARGING;
else if (battery->state == 0)
val->intval = POWER_SUPPLY_STATUS_FULL;
+   else
+   val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
break;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = acpi_battery_present(battery);


signature.asc
Description: This is a digitally signed message part.


[PATCH] Fix segfault when printing battery status

2007-11-19 Thread Rolf Eike Beer
cat 
/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_supply/BAT1/status

This leads to a stacktrace as acpi_battery_get_property() returns 0 for a 
case where it does not set val-intval. These value is used as an array 
index in drivers/power/power_supply_sysfs.c::power_supply_show_property(). 
I had a situation where the value was 4096 which caused a problem as the 
array only has 5 entries.

Signed-off-by: Rolf Eike Beer [EMAIL PROTECTED]

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 192c244..2e8e790 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -153,6 +153,8 @@ static int acpi_battery_get_property(struct power_supply 
*psy,
val-intval = POWER_SUPPLY_STATUS_CHARGING;
else if (battery-state == 0)
val-intval = POWER_SUPPLY_STATUS_FULL;
+   else
+   val-intval = POWER_SUPPLY_STATUS_UNKNOWN;
break;
case POWER_SUPPLY_PROP_PRESENT:
val-intval = acpi_battery_present(battery);


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] Fix segfault when printing battery status

2007-11-19 Thread Alexey Starikovskiy


Rolf Eike Beer wrote:

cat 
/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_supply/BAT1/status

This leads to a stacktrace as acpi_battery_get_property() returns 0 for a 
case where it does not set val-intval. These value is used as an array 
index in drivers/power/power_supply_sysfs.c::power_supply_show_property(). 
I had a situation where the value was 4096 which caused a problem as the 
array only has 5 entries.


Signed-off-by: Rolf Eike Beer [EMAIL PROTECTED]
  

Rolf, thanks for remainding.
Acked again,
Alex.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix segfault when printing battery status

2007-11-19 Thread Rolf Eike Beer
Alexey Starikovskiy wrote:
 Rolf Eike Beer wrote:
  cat
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_
 supply/BAT1/status
 
  This leads to a stacktrace as acpi_battery_get_property() returns 0 for a
  case where it does not set val-intval. These value is used as an array
  index in
  drivers/power/power_supply_sysfs.c::power_supply_show_property(). I had a
  situation where the value was 4096 which caused a problem as the array
  only has 5 entries.
 
  Signed-off-by: Rolf Eike Beer [EMAIL PROTECTED]

 Rolf, thanks for remainding.

Huh? This one is unrelated to the problem I reported two weeks ago...

Eike


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] Fix segfault when printing battery status

2007-11-19 Thread Alexey Starikovskiy

Rolf Eike Beer wrote:

Alexey Starikovskiy wrote:
  

Rolf Eike Beer wrote:


cat
/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/PNP0C0A:00/power_
supply/BAT1/status

This leads to a stacktrace as acpi_battery_get_property() returns 0 for a
case where it does not set val-intval. These value is used as an array
index in
drivers/power/power_supply_sysfs.c::power_supply_show_property(). I had a
situation where the value was 4096 which caused a problem as the array
only has 5 entries.

Signed-off-by: Rolf Eike Beer [EMAIL PROTECTED]
  

Rolf, thanks for remainding.



Huh? This one is unrelated to the problem I reported two weeks ago...

Eike
  

You are second to send the same patch, first one I already acked.
But it seems that Len did not pick it up yet.
Look for ACPI: Always return valid 'status' from 
acpi_battery_get_property()

if interested...

Regards,
Alex.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/