lkml.org 
[lkml]   [2019]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers/net: release skb on failure
Date
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@gmail.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
\
 
 \ /
  Last update: 2019-09-18 06:46    [W:0.033 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site