Skip to contentSkip to conversation

emulator: fail when SCO connection setup fails

PATCH New Simon Fels 1 participant 1 message Nov 17, 2015

lore
Share & tools
lore

Simon Fels

author
#0 lore raw

PATCH 1/1 emulator: fail when SCO connection setup fails

---
 src/emulator.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/emulator.c +6 -1
index 4c81a39..0a5c67e 100644
@@ -1683,6 +1683,7 @@ int ofono_emulator_start_codec_negotiation(struct ofono_emulator *em,
 {
 	char buf[64];
 	unsigned char codec;
+	int err;
 
 	if (em == NULL)
 		return -EINVAL;
@@ -1707,7 +1708,11 @@ int ofono_emulator_start_codec_negotiation(struct ofono_emulator *em,
 		 * already have a negotiated codec we can proceed here
 		 * without doing any negotiation again.
 		 */
-		ofono_handsfree_card_connect_sco(em->card);
+		err = ofono_handsfree_card_connect_sco(em->card);
+		if (err < 0) {
+			ofono_error("SCO connection failed");
+			return err;
+		}
 
 		return 0;
 	}
Signature · 1 line
2.5.0