From: Yunhee Seo Date: Thu, 19 Jan 2023 06:24:23 +0000 (+0900) Subject: touchscreen: clean-up uninitialized variable warning by static analysis X-Git-Tag: accepted/tizen/7.0/unified/20230126.170233~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a290b9622bb4ee5afd85cf088daf41485a2648f;p=platform%2Fcore%2Fsystem%2Fdeviced.git touchscreen: clean-up uninitialized variable warning by static analysis Add return code to avoid reaching uninitialized enum variable "state". Change-Id: Idce5e24bc2c979c350629b8e413494dd62003cf5 Signed-off-by: Yunhee Seo (cherry picked from commit 5d024fdb8bd0ab5d493ddaeeccd0fff5bc9472f8) --- diff --git a/src/touchscreen/touchscreen.c b/src/touchscreen/touchscreen.c index 183a407..d7d0c18 100644 --- a/src/touchscreen/touchscreen.c +++ b/src/touchscreen/touchscreen.c @@ -242,8 +242,10 @@ static int touchscreen_dump(FILE *fp, int mode, void *dump_data) if (!touchscreen_dev_available || (ret == -ENODEV)) return 0; - if (ret < 0) + if (ret < 0) { _E("Failed to get touchscreen state: %d", ret); + return ret; + } if (state == TOUCHSCREEN_ON) LOG_DUMP(fp, "Touchscreen is enabled\n");