Fix the bug that system-server is crashed during power-off. 10/14910/1
authorsh.pi <sh.pi@samsung.com>
Fri, 3 May 2013 08:35:16 +0000 (17:35 +0900)
committerKrzysztof Sasiak <k.sasiak@samsung.com>
Mon, 13 Jan 2014 15:15:35 +0000 (16:15 +0100)
pmsys is freed during power-off.
But deviced changes the brightness by light sensor.
and it accesses pmsys node.
now pmsys pointer is checked when brightness is changed.

Change-Id: I1b9e6538b78a6b0f1d18d51592c89cc8eebabb36
Signed-off-by: Krzysztof Sasiak <k.sasiak@samsung.com>
src/display/llinterface.c

index 02c8a17..5dd6352 100644 (file)
@@ -365,6 +365,9 @@ static int backlight_restore(void)
 
 static int set_default_brt(int level)
 {
+       if (!pmsys)
+               return -EFAULT;
+
        if (level < PM_MIN_BRIGHTNESS || level > PM_MAX_BRIGHTNESS)
                level = PM_DEFAULT_BRIGHTNESS;
        pmsys->def_brt = level;