aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index f223cdc75da6..e59840010d45 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -952,9 +952,11 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
952 goto adjust_others; 952 goto adjust_others;
953 } 953 }
954 954
955 data = kmalloc(size + sizeof(struct skb_shared_info), gfp_mask); 955 data = kmalloc(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
956 gfp_mask);
956 if (!data) 957 if (!data)
957 goto nodata; 958 goto nodata;
959 size = SKB_WITH_OVERHEAD(ksize(data));
958 960
959 /* Copy only real data... and, alas, header. This should be 961 /* Copy only real data... and, alas, header. This should be
960 * optimized for the cases when header is void. 962 * optimized for the cases when header is void.
@@ -3161,6 +3163,8 @@ static void sock_rmem_free(struct sk_buff *skb)
3161 */ 3163 */
3162int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) 3164int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
3163{ 3165{
3166 int len = skb->len;
3167
3164 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= 3168 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
3165 (unsigned)sk->sk_rcvbuf) 3169 (unsigned)sk->sk_rcvbuf)
3166 return -ENOMEM; 3170 return -ENOMEM;
@@ -3175,7 +3179,7 @@ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
3175 3179
3176 skb_queue_tail(&sk->sk_error_queue, skb); 3180 skb_queue_tail(&sk->sk_error_queue, skb);
3177 if (!sock_flag(sk, SOCK_DEAD)) 3181 if (!sock_flag(sk, SOCK_DEAD))
3178 sk->sk_data_ready(sk, skb->len); 3182 sk->sk_data_ready(sk, len);
3179 return 0; 3183 return 0;
3180} 3184}
3181EXPORT_SYMBOL(sock_queue_err_skb); 3185EXPORT_SYMBOL(sock_queue_err_skb);