net: virtio: simplify the virtnet_find_vqs
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Thu, 31 May 2018 14:16:32 +0000 (07:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Jun 2018 13:33:22 +0000 (09:33 -0400)
Use the common free functions while return successfully.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c

index 2d55e2af7cb6cc0058382d66d3ad8213e49d158a..6d710b8b41c5af7fc0195b3398582c9cd31ab48b 100644 (file)
@@ -2609,12 +2609,8 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
                vi->sq[i].vq = vqs[txq2vq(i)];
        }
 
-       kfree(names);
-       kfree(callbacks);
-       kfree(vqs);
-       kfree(ctx);
+       /* run here: ret == 0. */
 
-       return 0;
 
 err_find:
        kfree(ctx);