[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190918044521.14953-1-navid.emamdoost@gmail.com>
Date: Tue, 17 Sep 2019 23:45:21 -0500
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: emamd001@....edu, smccaman@....edu, kjlu@....edu,
Navid Emamdoost <navid.emamdoost@...il.com>,
Manish Chopra <manishc@...vell.com>,
GR-Linux-NIC-Dev@...vell.com,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drivers/net: release skb on failure
In ql_run_loopback_test, ql_lb_send does not release skb when fails. So
it must be released before returning.
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
index a6886cc5654c..d539b71b2a5c 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
@@ -544,8 +544,10 @@ static int ql_run_loopback_test(struct ql_adapter *qdev)
skb_put(skb, size);
ql_create_lb_frame(skb, size);
rc = ql_lb_send(skb, qdev->ndev);
- if (rc != NETDEV_TX_OK)
+ if (rc != NETDEV_TX_OK) {
+ dev_kfree_skb_any(skb);
return -EPIPE;
+ }
atomic_inc(&qdev->lb_count);
}
/* Give queue time to settle before testing results. */
--
2.17.1
Powered by blists - more mailing lists