diff options
author | Mark A. Greer <mgreer@animalcreek.com> | 2014-02-26 13:54:41 -0700 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-03-19 02:10:06 +0100 |
commit | c9b075b4fe55b7978340c439edd57714e5080100 (patch) | |
tree | fe17d58a7974658188e4b427197238ae29d4b927 | |
parent | fbb4e157a414ba662b1944c1dd326093969ac271 (diff) | |
download | neard-c9b075b4fe55b7978340c439edd57714e5080100.tar.gz neard-c9b075b4fe55b7978340c439edd57714e5080100.tar.bz2 neard-c9b075b4fe55b7978340c439edd57714e5080100.zip |
nfctype4: Only call callback once when writing
To perform a write operation, nfctype4_write()
calls data_write() which starts the write operation
and it is continued by data_write_cb() until the
operation is complete. Once the write operation
is complete, data_write_cb() calls the callback
routine.
Unfortunately, nfctype4_write() also calls the
callback routine unconditionally when data_write()
returns. This results in the callback being called
twice for successful write operations.
Instead, make nfctype4_write() return immediately
after calling data_write() because data_write_cb()
calls the callback when writes are successful and
data_write() already calls the callback and does
the clean up when there is an error.
-rw-r--r-- | plugins/nfctype4.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/nfctype4.c b/plugins/nfctype4.c index 427fbff..9192c78 100644 --- a/plugins/nfctype4.c +++ b/plugins/nfctype4.c @@ -682,7 +682,7 @@ static int nfctype4_write(uint32_t adapter_idx, uint32_t target_idx, goto out_err; } - err = data_write(adapter_idx, target_idx, ndef, tag, cb); + return data_write(adapter_idx, target_idx, ndef, tag, cb); out_err: if (cb) |