From 15730cbe967a70faa5cff3ee6df4842022298b23 Mon Sep 17 00:00:00 2001 From: liuhongchao Date: Thu, 16 Jan 2025 11:15:37 +0800 Subject: [PATCH] drivertest: release fd resources. Signed-off-by: liuhongchao --- testing/drivertest/drivertest_touchpanel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/drivertest/drivertest_touchpanel.c b/testing/drivertest/drivertest_touchpanel.c index c84369b0f..89455b96f 100644 --- a/testing/drivertest/drivertest_touchpanel.c +++ b/testing/drivertest/drivertest_touchpanel.c @@ -642,9 +642,10 @@ void touchpad_deinit(touchpad_s *touchpad) touchpad->indev = NULL; } - if (touchpad->fd > 0) + if (touchpad->fd >= 0) { close(touchpad->fd); + touchpad->fd = -1; } free(touchpad);