diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-07-23 13:00:21 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-07-23 13:00:21 +0000 |
commit | 30a072da30080032ba9b54d9651b0771ba421846 (patch) | |
tree | af4c5376dc5f09f9a22ff7de0f700c55fb56174c | |
parent | 45164afdd713dabd8389834a0be0edd006a588ba (diff) |
Small coding style fixes
-rw-r--r-- | audio/headset.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/audio/headset.c b/audio/headset.c index 3af4d05a..c8de6cf4 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -341,6 +341,7 @@ static void pending_connect_ok(struct pending_connect *c, struct device *dev) } else if (c->pkt) headset_get_config(dev, c->sock, c->pkt); + pending_connect_free(c); } @@ -984,10 +985,12 @@ static DBusHandlerResult hs_connect(DBusConnection *conn, DBusMessage *msg, c->msg = dbus_message_ref(msg); - if ((err = rfcomm_connect(device, c)) < 0) + err = rfcomm_connect(device, c); + if (err < 0) goto error; return DBUS_HANDLER_RESULT_HANDLED; + error: pending_connect_free(c); return err_connect_failed(conn, msg, strerror(-err)); @@ -1384,7 +1387,8 @@ int headset_get_config(void *device, int sock, struct ipc_packet *pkt) goto error; c->sock = sock; c->pkt = pkt; - if ((err = rfcomm_connect(device, c)) < 0) + err = rfcomm_connect(device, c); + if (err = < 0) goto error; return 0; } @@ -1394,7 +1398,8 @@ int headset_get_config(void *device, int sock, struct ipc_packet *pkt) goto error; c->sock = sock; c->pkt = pkt; - if ((err = sco_connect(device, c)) < 0) + err = sco_connect(device, c); + if (err < 0) goto error; return 0; } @@ -1409,6 +1414,7 @@ int headset_get_config(void *device, int sock, struct ipc_packet *pkt) cfg->rate = 8000; return 0; + error: if (c) pending_connect_free(c); |