From 90873c5d35ebd07d9c473507693db0585f767e31 Mon Sep 17 00:00:00 2001 From: Dragos Tarcatu Date: Mon, 2 Sep 2019 16:37:54 +0300 Subject: [PATCH] sof-ctl: fix segfault when no ctl name given If no control name is passed to sof-ctl, it currently pops an error, dumps the usage and then segfaults: root@gr-mrb:~# sof-ctl -D hw:0 Error: No control was requested. Usage: ... Segmentation fault (core dumped) Fix all that by jumping to the right label. Signed-off-by: Dragos Tarcatu --- tools/ctl/ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ctl/ctl.c b/tools/ctl/ctl.c index cfcc401a4..16db20759 100644 --- a/tools/ctl/ctl.c +++ b/tools/ctl/ctl.c @@ -544,7 +544,7 @@ int main(int argc, char *argv[]) if (!ctl_data->cname) { fprintf(stderr, "Error: No control was requested.\n"); usage(argv[0]); - goto data_free; + goto struct_free; }