[PATCH 1/3] test: dm: free gpio in dm_test_gpio_requestf()

Pranav Sanwal <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <[email protected]>
dm_test_gpio_requestf() requests a GPIO via gpio_requestf() but never
frees it, unlike every other test in this file. Free it before
returning.

Signed-off-by: Pranav Sanwal <[email protected]>
---
 test/dm/gpio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/dm/gpio.c b/test/dm/gpio.c
index b45946c143c..b872dac9082 100644
--- a/test/dm/gpio.c
+++ b/test/dm/gpio.c
@@ -282,6 +282,8 @@ static int dm_test_gpio_requestf(struct unit_test_state *uts)
 	ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf)));
 	ut_asserteq_str("b5: output: 1 [x] testing 1 hi", buf);
 
+	ut_assertok(gpio_free(gpio));
+
 	return 0;
 }
 DM_TEST(dm_test_gpio_requestf, UTF_SCAN_PDATA | UTF_SCAN_FDT);
-- 
2.43.7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.