diff options
author | Arron Wang <arron.wang@intel.com> | 2014-05-21 00:53:23 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-05-21 00:53:23 +0200 |
commit | 5a607b4e78e447ecb479021686e7ff0b9f1d773b (patch) | |
tree | c751b0066f0b331b76ead96999ea3858afbc55a6 | |
parent | 082d5bc681ba7aa64dc725c2cca48a24cec69193 (diff) | |
download | neard-5a607b4e78e447ecb479021686e7ff0b9f1d773b.tar.gz neard-5a607b4e78e447ecb479021686e7ff0b9f1d773b.tar.bz2 neard-5a607b4e78e447ecb479021686e7ff0b9f1d773b.zip |
se: Fix close channel error
in close_channel_cb, return value 0 means the success operation
when channel path is removed in hash table, __seel_channel_remove
will be called by se_channel_free.
-rw-r--r-- | se/se.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -596,20 +596,18 @@ static void close_channel_cb(void *context, uint8_t *apdu, size_t apdu_length, conn = near_dbus_get_connection(); - if (!err) + if (err) return close_channel_error(ctx, err); /* Check response status */ err = __seel_apdu_resp_status(apdu, apdu_length); - if (!err) + if (err) return close_channel_error(ctx, err); channel_path = __seel_channel_get_path(ctx->channel); if (!g_hash_table_remove(ctx->se->channel_hash, channel_path)) return close_channel_error(ctx, -ENODEV); - __seel_channel_remove(ctx->channel); - g_dbus_send_reply(conn, ctx->msg, DBUS_TYPE_INVALID); dbus_message_unref(ctx->msg); @@ -631,7 +629,7 @@ static DBusMessage *close_channel(DBusConnection *conn, if (se->enabled == false) return __near_error_failed(msg, ENODEV); - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &path, + if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) return __near_error_invalid_arguments(msg); |