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
*** This bug has been marked as a duplicate of bug 14797 ***