[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200708041600.768775-17-warthog618@gmail.com>
Date: Wed, 8 Jul 2020 12:15:59 +0800
From: Kent Gibson <warthog618@...il.com>
To: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
bgolaszewski@...libre.com, linus.walleij@...aro.org
Cc: Kent Gibson <warthog618@...il.com>
Subject: [PATCH 16/17] tools: gpio: fix spurious close warning in gpio-utils
Fix bogus close warning that occurs when opening the character device
fails.
Signed-off-by: Kent Gibson <warthog618@...il.com>
---
tools/gpio/gpio-utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/gpio/gpio-utils.c b/tools/gpio/gpio-utils.c
index 06003789e7c7..16a5d9cb9da2 100644
--- a/tools/gpio/gpio-utils.c
+++ b/tools/gpio/gpio-utils.c
@@ -75,7 +75,7 @@ int gpiotools_request_linehandle(const char *device_name, unsigned int *lines,
ret = -errno;
fprintf(stderr, "Failed to open %s, %s\n",
chrdev_name, strerror(errno));
- goto exit_close_error;
+ goto exit_free_name;
}
for (i = 0; i < nlines; i++)
@@ -94,9 +94,9 @@ int gpiotools_request_linehandle(const char *device_name, unsigned int *lines,
"GPIO_GET_LINEHANDLE_IOCTL", ret, strerror(errno));
}
-exit_close_error:
if (close(fd) == -1)
perror("Failed to close GPIO character device file");
+exit_free_name:
free(chrdev_name);
return ret < 0 ? ret : req.fd;
}
--
2.27.0
Powered by blists - more mailing lists