All of lore.kernel.org
 help / color / mirror / Atom feed
From: lishengyu <lishengyu@uniontech.com>
To: linux-bluetooth@vger.kernel.org
Cc: lishengyu <lishengyu@uniontech.com>
Subject: [PATCH BlueZ] avdtp: fix possible minor problems
Date: Wed, 29 Jun 2022 20:46:56 +0800	[thread overview]
Message-ID: <20220629124656.10174-1-lishengyu@uniontech.com> (raw)

It should always be considered that if send_request fails, sep
should be removed from the list and the requested memory freed;
---
 profiles/audio/avdtp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 0d2213ea2..10ef380d4 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -2765,8 +2765,11 @@ static gboolean avdtp_discover_resp(struct avdtp *session,
 
 		ret = send_request(session, TRUE, NULL, getcap_cmd,
 							&req, sizeof(req));
-		if (ret < 0)
+		if (ret < 0) {
+			session->seps = g_slist_remove(session->seps, sep);
+			g_free(sep);
 			break;
+		}
 		getcap_pending = TRUE;
 	}
 
-- 
2.20.1




             reply	other threads:[~2022-06-29 12:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 12:46 lishengyu [this message]
2022-06-29 13:55 ` [BlueZ] avdtp: fix possible minor problems bluez.test.bot
2022-06-30 20:40 ` [PATCH BlueZ] " 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=20220629124656.10174-1-lishengyu@uniontech.com \
    --to=lishengyu@uniontech.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.