Skip to content

Commit aaee24a

Browse files
mgreerazSamuel Ortiz
authored andcommitted
NFC: trf7970a: Add NULL check to clear up smatch warning
Although it should be unnecessary, add a NULL pointer check to trf7970a_send_upstream() to eliminate a smatch warning. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Mark Greer <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
1 parent ae291f7 commit aaee24a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/nfc/trf7970a.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,9 @@ static void trf7970a_send_upstream(struct trf7970a *trf)
629629
}
630630

631631
if (trf->adjust_resp_len) {
632-
skb_trim(trf->rx_skb, trf->rx_skb->len - 1);
632+
if (trf->rx_skb)
633+
skb_trim(trf->rx_skb, trf->rx_skb->len - 1);
634+
633635
trf->adjust_resp_len = false;
634636
}
635637

0 commit comments

Comments
 (0)