projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b66336
)
st21nfca_connectivity_event_received: null check the allocation
author
Navid Emamdoost
<navid.emamdoost@gmail.com>
Tue, 23 Jul 2019 22:04:30 +0000
(17:04 -0500)
committer
David S. Miller
<davem@davemloft.net>
Thu, 25 Jul 2019 18:47:10 +0000
(11:47 -0700)
devm_kzalloc may fail and return null. So the null check is needed.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/nfc/st21nfca/se.c
patch
|
blob
|
history
diff --git
a/drivers/nfc/st21nfca/se.c
b/drivers/nfc/st21nfca/se.c
index 06fc542fd19876d16c0a6e8e39de654340cc2b5a..6586378cacb05ed6b80bcc8c9c350010f7e88905 100644
(file)
--- a/
drivers/nfc/st21nfca/se.c
+++ b/
drivers/nfc/st21nfca/se.c
@@
-317,6
+317,8
@@
int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
transaction = (struct nfc_evt_transaction *)devm_kzalloc(dev,
skb->len - 2, GFP_KERNEL);
+ if (!transaction)
+ return -ENOMEM;
transaction->aid_len = skb->data[1];
memcpy(transaction->aid, &skb->data[2],