OSDN Git Service

Fix warnings.
authorLuiz Augusto von Dentz <luiz.dentz@indt.org.br>
Mon, 4 Aug 2008 13:03:37 +0000 (10:03 -0300)
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>
Mon, 4 Aug 2008 13:03:37 +0000 (10:03 -0300)
input/device.c
src/dbus-hci.c

index a9e5622..8f459c1 100644 (file)
@@ -520,14 +520,14 @@ static int hidp_connadd(bdaddr_t *src, bdaddr_t *dst,
        }
 
        err = ioctl(ctl, HIDPCONNADD, &req);
-       if (err < 0)
+       if (err < 0) {
+               close(ctl);
                goto cleanup;
+       }
 
        info("New input device %s (%s)", addr, req.name);
 
 cleanup:
-       close(ctl);
-
        if (req.rd_data)
                free(req.rd_data);
 
index e499aca..7697f38 100644 (file)
@@ -370,7 +370,7 @@ int hcid_dbus_request_pin(int dev, bdaddr_t *sba, struct hci_conn_info *ci)
        char addr[18];
        struct adapter *adapter;
        struct btd_device *device;
-       struct agent *agent;
+       struct agent *agent = NULL;
        int ret;
 
        adapter = manager_find_adapter(sba);
@@ -619,7 +619,7 @@ int hcid_dbus_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
 {
        struct adapter *adapter;
        struct btd_device *device;
-       struct agent *agent;
+       struct agent *agent = NULL;
        char addr[18];
        struct pending_auth_info *auth;
 
@@ -659,7 +659,7 @@ int hcid_dbus_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
 {
        struct adapter *adapter;
        struct btd_device *device;
-       struct agent *agent;
+       struct agent *agent = NULL;
        char addr[18];
        struct pending_auth_info *auth;
 
@@ -1765,7 +1765,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote,
 {
        struct adapter *adapter;
        struct btd_device *device;
-       struct agent *agent;
+       struct agent *agent = NULL;
        char addr[18];
 
        adapter = manager_find_adapter(local);