Skip to content

Commit 44378c4

Browse files
HongChao6xiaoxiang781216
authored andcommitted
drivertest: release fd resources.
Signed-off-by: liuhongchao <[email protected]>
1 parent 86e7e17 commit 44378c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testing/drivertest/drivertest_touchpanel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,10 @@ void touchpad_deinit(touchpad_s *touchpad)
642642
touchpad->indev = NULL;
643643
}
644644

645-
if (touchpad->fd > 0)
645+
if (touchpad->fd >= 0)
646646
{
647647
close(touchpad->fd);
648+
touchpad->fd = -1;
648649
}
649650

650651
free(touchpad);

0 commit comments

Comments
 (0)