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>
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;