display: fix error handling in rotation API 51/287051/1
authorTaeminYeom <taemin.yeom@samsung.com>
Thu, 19 Jan 2023 06:13:25 +0000 (15:13 +0900)
committerTaeminYeom <taemin.yeom@samsung.com>
Thu, 19 Jan 2023 06:13:25 +0000 (15:13 +0900)
Previous else if statement was unreachable
because negative "ret" value situation is already handled above code.
The else if statement should handle the situation that deviced operation failed,
so it should check "reply", not "ret".

Change-Id: I65d842e7cd46afcd244b8fbdb5a1af7d03444f2d
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
src/display.c

index 92131ea..fdfab3f 100644 (file)
@@ -668,7 +668,7 @@ int device_display_set_rotation_angle(int display_index,
        if (reply == -ENODEV) {
                _E("Set display rotation is not supported");
                return DEVICE_ERROR_OPERATION_FAILED;
-       } else if (ret < 0) {
+       } else if (reply < 0) {
                _E("Failed to set display rotation angle");
                return DEVICE_ERROR_OPERATION_FAILED;
        }