提交 43d53c29 编写于 作者: S Szymon Janc 提交者: Samuel Ortiz

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: NSzymon Janc <szymon.janc@gmail.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 249eb5bd
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册