From 643a606fa2742b94f6eca620119b7d2686ca9cd3 Mon Sep 17 00:00:00 2001 From: Christos Margiolis Date: Sat, 6 Dec 2025 15:28:08 +0100 Subject: [PATCH] sndctl(8): Do not free and re-open device There was a reason for this, but it does not apply anymore. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54031 --- usr.sbin/sndctl/sndctl.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/usr.sbin/sndctl/sndctl.c b/usr.sbin/sndctl/sndctl.c index 6977f0ab0eb..e6dac67e2ea 100644 --- a/usr.sbin/sndctl/sndctl.c +++ b/usr.sbin/sndctl/sndctl.c @@ -992,17 +992,10 @@ main(int argc, char *argv[]) argv++; } - free_dev(dp); - if (show) { - /* - * Re-read dev to reflect new state in case we changed some - * property. - */ - dp = read_dev(path); print_dev(dp); - free_dev(dp); } + free_dev(dp); return (0); }