From: Samuel Ortiz Date: Mon, 5 Mar 2012 00:03:39 +0000 (+0100) Subject: NFC: Clear pn533 target structure X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=98b3ac1b980b0c0ffff24fda8d13ab8c216df4d1;p=linux-beck.git NFC: Clear pn533 target structure The polled target structure should be memset to 0 in order to avoid sel_res and sens_res garbage. Signed-off-by: Samuel Ortiz Signed-off-by: John W. Linville --- diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index 8be0ae626d73..a5766042f0ee 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c @@ -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) {