net: hns3: fixes the ring index in hns3_fini_ring
authorLipeng <lipeng321@huawei.com>
Tue, 10 Oct 2017 08:42:03 +0000 (16:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Oct 2017 20:09:13 +0000 (13:09 -0700)
This patch fixes the ring index in hns3_fini_ring.

Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c

index 26bbc91add6511e473e9297d477b0bbed25d79a7..acb82cfc1b9a2241105ba61be3a5af0f4929dda1 100644 (file)
@@ -2661,7 +2661,7 @@ static int hns3_init_all_ring(struct hns3_nic_priv *priv)
 
 out_when_alloc_ring_memory:
        for (j = i - 1; j >= 0; j--)
-               hns3_fini_ring(priv->ring_data[i].ring);
+               hns3_fini_ring(priv->ring_data[j].ring);
 
        return -ENOMEM;
 }