summaryrefslogtreecommitdiffstats
path: root/kernel/net/rds/tcp_recv.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/net/rds/tcp_recv.c')
-rw-r--r--kernel/net/rds/tcp_recv.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/net/rds/tcp_recv.c b/kernel/net/rds/tcp_recv.c
index fbc5ef88b..27a992154 100644
--- a/kernel/net/rds/tcp_recv.c
+++ b/kernel/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 -> "