NFC: trf7970a: Add NULL check to clear up smatch warning
authorMark Greer <mgreer@animalcreek.com>
Wed, 19 Aug 2015 15:58:52 +0000 (08:58 -0700)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 19 Aug 2015 17:17:45 +0000 (19:17 +0200)
Although it should be unnecessary, add a NULL pointer check
to trf7970a_send_upstream() to eliminate a smatch warning.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/trf7970a.c

index 08f23d7..70b0707 100644 (file)
@@ -629,7 +629,9 @@ static void trf7970a_send_upstream(struct trf7970a *trf)
        }
 
        if (trf->adjust_resp_len) {
-               skb_trim(trf->rx_skb, trf->rx_skb->len - 1);
+               if (trf->rx_skb)
+                       skb_trim(trf->rx_skb, trf->rx_skb->len - 1);
+
                trf->adjust_resp_len = false;
        }