nfctype3: Do not call write callback if the initial write command succeeds
authorOlivier Guiter <olivier.guiter@linux.intel.com>
Thu, 14 Feb 2013 15:19:50 +0000 (16:19 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 14 Feb 2013 15:50:45 +0000 (16:50 +0100)
When write-tag on a type 3 tag, the command returns
with "Invalid arguments", though it actually writes successfully.

plugins/nfctype3.c

index 38117af..31b7504 100644 (file)
@@ -749,7 +749,7 @@ static int nfctype3_write(uint32_t adapter_idx, uint32_t target_idx,
        err = data_write(adapter_idx, target_idx, ndef, tag, cb);
 
 out_err:
-       if (cb != NULL)
+       if (cb != NULL && err < 0)
                cb(adapter_idx, target_idx, err);
 
        return err;