public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Null pointer check on cb in finalize_resume()
@ 2009-03-26 23:50 Nick Pelly
  2009-03-27  9:49 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Pelly @ 2009-03-26 23:50 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0002-Null-pointer-check-on-cb-in-finalize_resume.patch --]
[-- Type: text/x-patch, Size: 869 bytes --]

From 8f5f803f17bde189fc96a715498a98756ae9ff2b Mon Sep 17 00:00:00 2001
From: Nick Pelly <npelly@google.com>
Date: Thu, 26 Mar 2009 15:22:32 -0700
Subject: [PATCH] Null pointer check on cb in finalize_resume().

Fix a null pointer crash that occured when resuming A2DP streaming after making
an outgoing call.

This patch has not been verified in Bluez 4.x.
---
 audio/a2dp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/a2dp.c b/audio/a2dp.c
index 7461f17..5fd6be4 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -183,7 +183,7 @@ static gboolean finalize_resume(struct a2dp_setup *s)
 	for (l = s->cb; l != NULL; l = l->next) {
 		struct a2dp_setup_cb *cb = l->data;
 
-		if (cb->resume_cb) {
+		if (cb && cb->resume_cb) {
 			cb->resume_cb(s->session, s->err, cb->user_data);
 			cb->resume_cb = NULL;
 			setup_unref(s);
-- 
1.5.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-27  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-26 23:50 [PATCH] Null pointer check on cb in finalize_resume() Nick Pelly
2009-03-27  9:49 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox