NFC: digital: Fix handling of saved PDU sk_buff pointers
authorThierry Escande <thierry.escande@collabora.com>
Fri, 8 Jul 2016 13:52:39 +0000 (15:52 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 10 Jul 2016 23:55:42 +0000 (01:55 +0200)
commit1d984c2e03c1fb21539a9f50627e312788512013
treefe898192971b22ae77a37720a63737c3a0a9023c
parent3cc952dbf1a7176b9247da4cd2612c9ddc1d1b51
NFC: digital: Fix handling of saved PDU sk_buff pointers

This patch fixes the way an I-PDU is saved in case it needs to be sent
again. It is now copied using pskb_copy() and not simply referenced
using skb_get() since it could be modified by the driver.

digital_in_send_saved_skb() and digital_tg_send_saved_skb() still get a
reference on the saved skb which is re-sent but release it if the send
operation fails. That way the caller doesn't have to take care about skb
ref in case of error.

RTOX supervisor PDU must not be saved as this can override a previously
saved I-PDU that should be re-sent later on.

Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
include/net/nfc/digital.h
net/nfc/digital_dep.c