From 2fa3c8a8b23041490b279d2630f1cfc9fae242fb Mon Sep 17 00:00:00 2001 From: Tonghao Zhang Date: Thu, 31 May 2018 07:16:32 -0700 Subject: [PATCH] net: virtio: simplify the virtnet_find_vqs Use the common free functions while return successfully. Signed-off-by: Tonghao Zhang Signed-off-by: David S. Miller --- drivers/net/virtio_net.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 2d55e2af7cb6..6d710b8b41c5 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -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); -- 2.30.2