mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
tools: gpio: fix spurious close warning in gpio-event-mon
Fix bogus close warning that occurs when opening the character device fails. Signed-off-by: Kent Gibson <warthog618@gmail.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
committed by
Bartosz Golaszewski
parent
e890678f69
commit
df51f402e3
@@ -45,7 +45,7 @@ int monitor_device(const char *device_name,
|
|||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
fprintf(stderr, "Failed to open %s\n", chrdev_name);
|
fprintf(stderr, "Failed to open %s\n", chrdev_name);
|
||||||
goto exit_close_error;
|
goto exit_free_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
req.lineoffset = line;
|
req.lineoffset = line;
|
||||||
@@ -117,6 +117,7 @@ int monitor_device(const char *device_name,
|
|||||||
exit_close_error:
|
exit_close_error:
|
||||||
if (close(fd) == -1)
|
if (close(fd) == -1)
|
||||||
perror("Failed to close GPIO character device file");
|
perror("Failed to close GPIO character device file");
|
||||||
|
exit_free_name:
|
||||||
free(chrdev_name);
|
free(chrdev_name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user