diff options
author | David S. Miller <davem@davemloft.net> | 2015-11-01 05:15:30 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-01 05:15:30 +0100 |
commit | b75ec3af27bf011a760e2f44eb25a99b6fbb0fb3 (patch) | |
tree | 89f4fbab2c6194b32a46eb771c4b158585bf0bb5 /net/rds | |
parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klasse... (diff) | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sag... (diff) | |
download | linux-b75ec3af27bf011a760e2f44eb25a99b6fbb0fb3.tar.xz linux-b75ec3af27bf011a760e2f44eb25a99b6fbb0fb3.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/rds')
-rw-r--r-- | net/rds/tcp_recv.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c index fbc5ef88bc0e..27a992154804 100644 --- a/net/rds/tcp_recv.c +++ b/net/rds/tcp_recv.c @@ -214,8 +214,15 @@ static int rds_tcp_data_recv(read_descriptor_t *desc, struct sk_buff *skb, } to_copy = min(tc->t_tinc_data_rem, left); - pskb_pull(clone, offset); - pskb_trim(clone, to_copy); + if (!pskb_pull(clone, offset) || + pskb_trim(clone, to_copy)) { + pr_warn("rds_tcp_data_recv: pull/trim failed " + "left %zu data_rem %zu skb_len %d\n", + left, tc->t_tinc_data_rem, skb->len); + kfree_skb(clone); + desc->error = -ENOMEM; + goto out; + } skb_queue_tail(&tinc->ti_skb_list, clone); rdsdebug("skb %p data %p len %d off %u to_copy %zu -> " |