提交 0e413f22 编写于 作者: S Shirley Ma 提交者: David S. Miller

virtio_net: missing sg_init_table

Add missing sg_init_table for sg_set_buf in virtio_net which
induced in defer skb patch.
Reported-by: NThomas Müller <thomas@mathtm.de>
Tested-by: NThomas Müller <thomas@mathtm.de>
Signed-off-by: NShirley Ma <xma@us.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4a1032fa
......@@ -327,6 +327,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp)
struct scatterlist sg[2];
int err;
sg_init_table(sg, 2);
skb = netdev_alloc_skb_ip_align(vi->dev, MAX_PACKET_LEN);
if (unlikely(!skb))
return -ENOMEM;
......@@ -352,6 +353,7 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)
char *p;
int i, err, offset;
sg_init_table(sg, MAX_SKB_FRAGS + 2);
/* page in sg[MAX_SKB_FRAGS + 1] is list tail */
for (i = MAX_SKB_FRAGS + 1; i > 1; --i) {
first = get_a_page(vi, gfp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册