Bug 14792 - variable 'err' reused without reinitialising in addon-dell-backlight.cpp (patch attached)
Summary: variable 'err' reused without reinitialising in addon-dell-backlight.cpp (pat...
Status: RESOLVED DUPLICATE of bug 14797
Alias: None
Product: hal
Classification: Unclassified
Component: hald (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL: https://bugs.launchpad.net/ubuntu/+bu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-03 05:16 UTC by Harry de Boer
Modified: 2008-03-04 04:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fix for addon-dell-brightness not checking err (1.29 KB, patch)
2008-03-03 05:16 UTC, Harry de Boer
Details | Splinter Review

Description Harry de Boer 2008-03-03 05:16:23 UTC
Created attachment 14784 [details] [review]
Fix for addon-dell-brightness not checking err

In addon-dell-backlight.cpp -> Get/SetBrightness the status of the ac_adapter.present is checked, but when the udi (/org/freedesktop/Hal/devices/acpi_AC) is not found the 'err' variable is set by the dbus call. Then, without checking if an error has occurred, the arguments from the original dbus call are read reusing 'err' which might not be properly intialised anymore (not 'null').

This results in not answering the dbus call which on the Gnome desktop hangs the gnome-power-manager for a while (including the brightness OSD).

The attached patch does the following:
* correctly free 'err' if it is set before reusing according to dbus spec.
* add check if udi for ac-adapter exists
* add check for udi as seen on dell inspiron 1501 (/org/freedesktop/Hal/devices/computer_power_supply)

The patch is against 0.5.10
Comment 1 Danny Kukawka 2008-03-04 04:45:46 UTC

*** This bug has been marked as a duplicate of bug 14797 ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.