From: Colin Ian King <colin.king(a)canonical.com>
the logic on the test for a valid fd to close is incorrect and
the current code will close -ve fd's which is not was intended.
Since the only path to the exit label is on a failed open, we
may as well just close fd if it has been opened successfully
before the exit label and also remove the valid fd check.
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
tools/power/acpi/tools/acpidbg/acpidbg.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/power/acpi/tools/acpidbg/acpidbg.c
index d070fcc..38ccac9 100644
@@ -429,9 +429,8 @@ int main(int argc, char **argv)
- if (fd < 0)
Show replies by date