From: Shirley Ma Date: Mon, 29 Mar 2010 15:19:15 +0000 (+0000) Subject: virtio_net: missing sg_init_table X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2c45cd43ff791cc4ab6a6332165ad53d7bcb3673;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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: Thomas Müller Tested-by: Thomas Müller Signed-off-by: Shirley Ma Signed-off-by: David S. Miller --- diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 25dc77ccbf58..3f5be35dea25 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -326,6 +326,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; @@ -351,6 +352,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);