From d3d75f3ddd26bf5544ee904f0db6e1be8b0f584f Mon Sep 17 00:00:00 2001 From: Umang Chheda Date: Mon, 7 Feb 2022 15:56:22 +0530 Subject: [PATCH] vibrator: Fix check for no of bytes in Slate SSR monitor thread No of bytes returned by uevent_kernel_multicast_recv() can be 0 or equal to 1025 bytes. Add change to remove '=' check in Slate SSR monitor thread to fix the issue of thread not processing UEVENTs because of wrong check. Change-Id: I6d8c35a758371b853b545e3eece2fd7788a1424e --- aidl/vibrator/VibratorOffload.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aidl/vibrator/VibratorOffload.cpp b/aidl/vibrator/VibratorOffload.cpp index 6922a9d..4111ae1 100644 --- a/aidl/vibrator/VibratorOffload.cpp +++ b/aidl/vibrator/VibratorOffload.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -82,7 +83,7 @@ void PatternOffload::SSREventListener(void) } while ((n = uevent_kernel_multicast_recv(device_fd, msg, UEVENT_MSG_LEN)) > 0) { - if (n <= 0 || n >= UEVENT_MSG_LEN) { + if (n <= 0 || n > UEVENT_MSG_LEN) { ALOGE("Message length %d is not correct\n", n); continue; }