mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
NFC: llcp: Fix possible memory leak while sending I frames
If sending was not completed due to low memory condition msg_data was not free before returning from function. Signed-off-by: Szymon Janc <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
249eb5bd74
commit
43d53c29dd
1 changed files with 3 additions and 1 deletions
|
|
@ -684,8 +684,10 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock,
|
|||
|
||||
pdu = llcp_allocate_pdu(sock, LLCP_PDU_I,
|
||||
frag_len + LLCP_SEQUENCE_SIZE);
|
||||
if (pdu == NULL)
|
||||
if (pdu == NULL) {
|
||||
kfree(msg_data);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
skb_put(pdu, LLCP_SEQUENCE_SIZE);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue