Diff between 3b7e90d9db2df4fcf287c109e95075755e013d20 and f8e0916e2d8687bd0a7db7591829550c949d8142

Changed Files

File Additions Deletions Status
audio/avdtp.c +4 -5 modified
audio/ctl_bluetooth.c +2 -4 modified
audio/headset.c +1 -2 modified
tools/hciattach_ti.c +4 -5 modified
tools/sdptool.c +1 -2 modified

Full Patch

diff --git a/audio/avdtp.c b/audio/avdtp.c
index 7e398db..6018c37 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -2243,22 +2243,22 @@ static uint16_t get_version(struct avdtp *session)
 
 	adapter = manager_find_adapter(&session->server->src);
 	if (!adapter)
-		goto done;
+		return ver;
 
 	ba2str(&session->dst, addr);
 	device = adapter_find_device(adapter, addr);
 	if (!device)
-		goto done;
+		return ver;
 
 	rec = btd_device_get_record(device, A2DP_SINK_UUID);
 	if (!rec)
 		rec = btd_device_get_record(device, A2DP_SOURCE_UUID);
 
 	if (!rec)
-		goto done;
+		return ver;
 
 	if (sdp_get_access_protos(rec, &protos) < 0)
-		goto done;
+		return ver;
 
 	proto_desc = sdp_get_proto_desc(protos, AVDTP_UUID);
 	if (proto_desc && proto_desc->dtd == SDP_UINT16)
@@ -2267,7 +2267,6 @@ static uint16_t get_version(struct avdtp *session)
 	sdp_list_foreach(protos, (sdp_list_func_t) sdp_list_free, NULL);
 	sdp_list_free(protos, NULL);
 
-done:
 	return ver;
 }
 
diff --git a/audio/ctl_bluetooth.c b/audio/ctl_bluetooth.c
index 2981385..d941421 100644
--- a/audio/ctl_bluetooth.c
+++ b/audio/ctl_bluetooth.c
@@ -213,11 +213,9 @@ static int bluetooth_read_integer(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key,
 	*value = 0;
 
 	ret = bluetooth_send_ctl(data, key, 0, rsp);
-	if (ret < 0)
-		goto done;
+	if (ret == 0)
+		*value = rsp->key;
 
-	*value = rsp->key;
-done:
 	return ret;
 }
 
diff --git a/audio/headset.c b/audio/headset.c
index 4540c34..e7a4ea4 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1771,7 +1771,7 @@ static DBusMessage *hs_ring(DBusConnection *conn, DBusMessage *msg,
 
 	if (ag.ring_timer) {
 		DBG("IndicateCall received when already indicating");
-		goto done;
+		return reply;
 	}
 
 	err = headset_send(hs, "\r\nRING\r\n");
@@ -1784,7 +1784,6 @@ static DBusMessage *hs_ring(DBusConnection *conn, DBusMessage *msg,
 	ag.ring_timer = g_timeout_add_seconds(RING_INTERVAL, ring_timer_cb,
 						NULL);
 
-done:
 	return reply;
 }
 
diff --git a/tools/hciattach_ti.c b/tools/hciattach_ti.c
index e107a65..6269181 100644
--- a/tools/hciattach_ti.c
+++ b/tools/hciattach_ti.c
@@ -119,7 +119,7 @@ static FILE *bts_load_script(const char* file_name, uint32_t* version)
 	fp = fopen(file_name, "rb");
 	if (!fp) {
 		perror("can't open firmware file");
-		goto out;
+		return NULL;
 	}
 
 	if (1 != fread(&header, sizeof(struct bts_header), 1, fp)) {
@@ -135,13 +135,12 @@ static FILE *bts_load_script(const char* file_name, uint32_t* version)
 	if (NULL != version)
 		*version = header.version;
 
-	goto out;
+	return fp;
 
 errclose:
 	fclose(fp);
-	fp = NULL;
-out:
-	return fp;
+
+	return NULL;
 }
 
 static unsigned long bts_fetch_action(FILE* fp, unsigned char* action_buf,
diff --git a/tools/sdptool.c b/tools/sdptool.c
index 140a46a..aea4954 100644
--- a/tools/sdptool.c
+++ b/tools/sdptool.c
@@ -4116,10 +4116,9 @@ static int cmd_records(int argc, char **argv)
 			context.handle = base[i] + n;
 			err = get_service(&bdaddr, &context, 1);
 			if (err < 0)
-				goto done;
+				return 0;
 		}
 
-done:
 	return 0;
 }