From c5fb3b5b680fa703f0ce5aae0fcd1b4f3477b2d3 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Thu, 6 Feb 2020 16:14:22 +0100 Subject: ipc_device_detect: handle read errors Signed-off-by: Denis 'GNUtoo' Carikli --- samsung-ipc/ipc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index c0cba8c..52c4b90 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -68,6 +68,8 @@ int ipc_device_detect(void) goto error; length = read(fd, &buffer, sizeof(buffer)); + if (length == -1) + goto error; close(fd); -- cgit v1.2.3