]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
NFC: digital: SENSF_RES excludes RD when SENSF_REQ RC is zero
authorMark A. Greer <mgreer@animalcreek.com>
Wed, 23 Apr 2014 18:00:55 +0000 (11:00 -0700)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 19 May 2014 21:52:37 +0000 (23:52 +0200)
The check in digital_tg_send_sensf_res() that excludes
the 'RD' field from the SENSF_RES is inverted.  The 'RD'
field should be excluded when the SENSF_REQ 'RC' field
is equal to DIGITAL_SENSF_REQ_RC_NONE instead of when
its not equal.  This is described in section 6.6.2.11
of the NFC Digital Specification.

CC: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/digital_technology.c

index 88e946adb7bf4850f35cdbaf5ee42ce17aed174e..c8dfb1b90fa0c3d83a48b8a00a0646940fb8a2e4 100644 (file)
@@ -1101,7 +1101,7 @@ static int digital_tg_send_sensf_res(struct nfc_digital_dev *ddev,
 
        size = sizeof(struct digital_sensf_res);
 
-       if (sensf_req->rc != DIGITAL_SENSF_REQ_RC_NONE)
+       if (sensf_req->rc == DIGITAL_SENSF_REQ_RC_NONE)
                size -= sizeof(sensf_res->rd);
 
        skb = digital_skb_alloc(ddev, size);