NFC: trf7970a: Cancel timer when error encountered
authorMark A. Greer <mgreer@animalcreek.com>
Tue, 2 Sep 2014 22:12:43 +0000 (15:12 -0700)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 7 Sep 2014 21:13:45 +0000 (23:13 +0200)
Some paths leave a timer still running when
trf7970a_send_err_upstream() is called.  This
can cause a timeout to occur in a subsequent
transaction making it fail.  Fix this by ensuring
there is no timer running before sending an error
upstream.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/trf7970a.c

index 0f09278ec37a0a26db878108c3906414ff4cab1b..00fb2cee679028d421790b0a82ede9a3078cd8e0 100644 (file)
@@ -506,6 +506,8 @@ static void trf7970a_send_err_upstream(struct trf7970a *trf, int errno)
 {
        dev_dbg(trf->dev, "Error - state: %d, errno: %d\n", trf->state, errno);
 
+       cancel_delayed_work(&trf->timeout_work);
+
        kfree_skb(trf->rx_skb);
        trf->rx_skb = ERR_PTR(errno);