diff options
| author | Colin Ian King <[email protected]> | 2023-07-12 15:01:22 +0100 |
|---|---|---|
| committer | Takashi Iwai <[email protected]> | 2023-07-13 08:08:08 +0200 |
| commit | 645e583d2689a1dd2163da28a7789b4d9febf316 (patch) | |
| tree | a2beecf07b7f3aea63067cc07b43f25876328196 /tools | |
| parent | 35bc3efb3157cc5a9c3b5853591c4dcef40f6029 (diff) | |
selftests: ALSA: Fix fclose on an already fclosed file pointer
In the case where a sysfs file cannot be opened the error return path
fcloses file pointer fpl, however, fpl has already been closed in the
previous stanza. Fix the double fclose by removing it.
Fixes: 10b98a4db11a ("selftests: ALSA: Add test for the 'pcmtest' driver")
Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/selftests/alsa/test-pcmtest-driver.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/testing/selftests/alsa/test-pcmtest-driver.c b/tools/testing/selftests/alsa/test-pcmtest-driver.c index 71931b240a83..357adc722cba 100644 --- a/tools/testing/selftests/alsa/test-pcmtest-driver.c +++ b/tools/testing/selftests/alsa/test-pcmtest-driver.c @@ -47,10 +47,8 @@ static int read_patterns(void) sprintf(pf, "/sys/kernel/debug/pcmtest/fill_pattern%d", i); fp = fopen(pf, "r"); - if (!fp) { - fclose(fpl); + if (!fp) return -1; - } fread(patterns[i].buf, 1, patterns[i].len, fp); fclose(fp); } |