aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/gpio/gpio-mockup-chardev.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/gpio/gpio-mockup-chardev.c')
-rw-r--r--tools/testing/selftests/gpio/gpio-mockup-chardev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/testing/selftests/gpio/gpio-mockup-chardev.c b/tools/testing/selftests/gpio/gpio-mockup-chardev.c
index f8d468f54e98..aaa1e9f083c3 100644
--- a/tools/testing/selftests/gpio/gpio-mockup-chardev.c
+++ b/tools/testing/selftests/gpio/gpio-mockup-chardev.c
@@ -37,7 +37,7 @@ static int get_debugfs(char **path)
37 struct libmnt_table *tb; 37 struct libmnt_table *tb;
38 struct libmnt_iter *itr = NULL; 38 struct libmnt_iter *itr = NULL;
39 struct libmnt_fs *fs; 39 struct libmnt_fs *fs;
40 int found = 0; 40 int found = 0, ret;
41 41
42 cxt = mnt_new_context(); 42 cxt = mnt_new_context();
43 if (!cxt) 43 if (!cxt)
@@ -58,8 +58,11 @@ static int get_debugfs(char **path)
58 break; 58 break;
59 } 59 }
60 } 60 }
61 if (found) 61 if (found) {
62 asprintf(path, "%s/gpio", mnt_fs_get_target(fs)); 62 ret = asprintf(path, "%s/gpio", mnt_fs_get_target(fs));
63 if (ret < 0)
64 err(EXIT_FAILURE, "failed to format string");
65 }
63 66
64 mnt_free_iter(itr); 67 mnt_free_iter(itr);
65 mnt_free_context(cxt); 68 mnt_free_context(cxt);