From: Youngjae Cho Date: Tue, 22 Nov 2022 10:52:02 +0000 (+0900) Subject: power: check operation is null X-Git-Tag: accepted/tizen/unified/20221128.014950^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d138e274e8c62aa49fc31615af98eea83d0f929;p=platform%2Fcore%2Fsystem%2Fdeviced.git power: check operation is null The iot-headless profile has been changed to have display module. - display: add dummy display for iot-headless (1985b78991d1fe925b827ded4fdae58d1b4e1d7a) Prevent crash on accessing not existing operation. Change-Id: I601e4cb8412423ed8ecca9d9c022b366e039690e Signed-off-by: Youngjae Cho --- diff --git a/src/power/power-off.c b/src/power/power-off.c index 89f9b19..91c8e52 100644 --- a/src/power/power-off.c +++ b/src/power/power-off.c @@ -88,7 +88,8 @@ static void disable_display(void) { const struct device_ops *display_device_ops = NULL; FIND_DEVICE_VOID(display_device_ops, "display"); - display_device_ops->stop(NORMAL_MODE); + if (display_device_ops->stop) + display_device_ops->stop(NORMAL_MODE); } static int disable_systemd_journald(void)