public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@arri.de>
To: <linux-bluetooth@vger.kernel.org>
Cc: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	Christian Eggers <ceggers@arri.de>
Subject: [PATCH] client: Add missing return statement in error path
Date: Thu, 25 Aug 2022 22:39:03 +0200	[thread overview]
Message-ID: <20220825203903.3526-1-ceggers@arri.de> (raw)

Client will SEGFAULT if default_ctrl==NULL

Fixes: 936ad5ef7b56 ("client: Quit when done with command")
Signed-off-by: Christian Eggers <ceggers@arri.de>
---
 client/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/main.c b/client/main.c
index 88c7ad799888..754157b169c6 100644
--- a/client/main.c
+++ b/client/main.c
@@ -2546,7 +2546,7 @@ static void cmd_advertise(int argc, char *argv[])
 
 	if (!default_ctrl || !default_ctrl->ad_proxy) {
 		bt_shell_printf("LEAdvertisingManager not found\n");
-		bt_shell_noninteractive_quit(EXIT_FAILURE);
+		return bt_shell_noninteractive_quit(EXIT_FAILURE);
 	}
 
 	if (enable == TRUE)
-- 
2.35.3


             reply	other threads:[~2022-08-25 20:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 20:39 Christian Eggers [this message]
2022-08-25 21:32 ` client: Add missing return statement in error path bluez.test.bot
2022-08-29 20:10 ` [PATCH] " patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220825203903.3526-1-ceggers@arri.de \
    --to=ceggers@arri.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox