diff options
author | Arron Wang <arron.wang@intel.com> | 2013-04-22 17:19:53 +0800 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-29 17:47:13 +0200 |
commit | d7fa49d22ac230099a8b3ae6b5b5f1228cc1a1c0 (patch) | |
tree | 4b6105b7c951c07bc2eadb334ddcaf6295544aaa | |
parent | 77d2717c4bfa6dfb7fe3915af045589332335475 (diff) | |
download | neard-d7fa49d22ac230099a8b3ae6b5b5f1228cc1a1c0.tar.gz neard-d7fa49d22ac230099a8b3ae6b5b5f1228cc1a1c0.tar.bz2 neard-d7fa49d22ac230099a8b3ae6b5b5f1228cc1a1c0.zip |
nfctyp3: Set cookie cb to NULL when read succeeds
Otherwise the callback function may be call twice and
write_msg is unreferenced twice:
process 1868: arguments to dbus_message_unref() were incorrect,
assertion "message != NULL" failed in file dbus-message.c line 1616
0 0xb7fe1424 in __kernel_vsyscall ()
1 0xb7bcfcc1 in raise () from /lib/libc.so.6
2 0xb7bd30ee in abort () from /lib/libc.so.6
3 0xb7da5045 in _dbus_abort () from /usr/lib/libdbus-1.so.3
4 0xb7d99f86 in _dbus_warn_check_failed () from /usr/lib/libdbus-1.so.3
5 0xb7d8856e in dbus_message_unref () from /usr/lib/libdbus-1.so.3
6 0x08062a63 in tag_read_cb (adapter_idx=0, target_idx=6, status=0)
at src/tag.c:240
7 0x08063277 in near_tag_add_records (tag=0x8081a30, records=0x8080270,
cb=0x8062a30 <tag_read_cb>, status=0) at src/tag.c:814
-rw-r--r-- | plugins/nfctype3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/nfctype3.c b/plugins/nfctype3.c index cb9d3b4..2f4ce75 100644 --- a/plugins/nfctype3.c +++ b/plugins/nfctype3.c @@ -370,7 +370,7 @@ static int nfctype3_recv_block_0(uint8_t *resp, int length, void *data) * As reading isn't complete, * callback shouldn't be called while freeing the cookie */ - if (err == 0) + if (err >= 0) cookie->cb = NULL; out_err: |