NFC: Clear pn533 target structure
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 5 Mar 2012 00:03:39 +0000 (01:03 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 6 Mar 2012 20:16:21 +0000 (15:16 -0500)
The polled target structure should be memset to 0 in order to avoid
sel_res and sens_res garbage.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/nfc/pn533.c

index 8be0ae626d73079669c4905d119f4227b6448b4d..a5766042f0ee0711e1f4357877d99d2792b3cc3e 100644 (file)
@@ -904,6 +904,8 @@ static int pn533_target_found(struct pn533 *dev,
        if (resp->tg != 1)
                return -EPROTO;
 
+       memset(&nfc_tgt, 0, sizeof(struct nfc_target));
+
        target_data_len = resp_len - sizeof(struct pn533_poll_response);
 
        switch (dev->poll_mod_curr) {