diff options
author | Szymon Janc <szymon.janc@gmail.com> | 2013-11-30 16:14:57 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-01-04 03:32:27 +0100 |
commit | 43d53c29dd8548404256c05573ff557c927d214b (patch) | |
tree | 92a4011a4a0eb8cf9e84621ac352002e69bc2c38 /net/nfc/llcp_commands.c | |
parent | NFC: Return driver failure upon unknown event reception (diff) | |
download | linux-43d53c29dd8548404256c05573ff557c927d214b.tar.xz linux-43d53c29dd8548404256c05573ff557c927d214b.zip |
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 <szymon.janc@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/llcp_commands.c')
-rw-r--r-- | net/nfc/llcp_commands.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c index 693cd1aad582..80057a818737 100644 --- a/net/nfc/llcp_commands.c +++ b/net/nfc/llcp_commands.c @@ -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); |