projects
/
platform
/
upstream
/
neard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2e1b68
)
tag: Do not unref a NULL write message
author
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 4 Nov 2013 23:26:14 +0000
(
00:26
+0100)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 4 Nov 2013 23:26:14 +0000
(
00:26
+0100)
After successfully writing a tag, the next read might fail in which case
tag_read_cb may be called several times. The pending write_msg pointer
needs to be unrefed only once.
src/tag.c
patch
|
blob
|
history
diff --git
a/src/tag.c
b/src/tag.c
index
fbc71c3
..
1d07f8b
100644
(file)
--- a/
src/tag.c
+++ b/
src/tag.c
@@
-284,8
+284,10
@@
static void tag_read_cb(uint32_t adapter_idx, uint32_t target_idx, int status)
if (!tag)
return;
- dbus_message_unref(tag->write_msg);
- tag->write_msg = NULL;
+ if (tag->write_msg) {
+ dbus_message_unref(tag->write_msg);
+ tag->write_msg = NULL;
+ }
__near_adapter_start_check_presence(adapter_idx, target_idx);