Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341508
b: refs/heads/master
c: 6e950fd
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Ortiz committed Nov 19, 2012
1 parent 8c54164 commit b7d9814
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08eaa1e0ce5bad11bedd311a9ddc3baf778ee1df
refs/heads/master: 6e950fd214645e71e94bce2429bea58b88e1b5d0
15 changes: 13 additions & 2 deletions trunk/net/nfc/llcp/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
struct sk_buff *pdu;
struct nfc_llcp_local *local;
size_t frag_len = 0, remaining_len;
u8 *msg_ptr;
u8 *msg_ptr, *msg_data;
int err;

pr_debug("Send UI frame len %zd\n", len);
Expand All @@ -588,8 +588,17 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
if (local == NULL)
return -ENODEV;

msg_data = kzalloc(len, GFP_KERNEL);
if (msg_data == NULL)
return -ENOMEM;

if (memcpy_fromiovec(msg_data, msg->msg_iov, len)) {
kfree(msg_data);
return -EFAULT;
}

remaining_len = len;
msg_ptr = (u8 *) msg->msg_iov;
msg_ptr = msg_data;

while (remaining_len > 0) {

Expand All @@ -616,6 +625,8 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap,
msg_ptr += frag_len;
}

kfree(msg_data);

return len;
}

Expand Down

0 comments on commit b7d9814

Please sign in to comment.