Skip to contentSkip to conversation

netcp:Fix error checking in the function gbe_open

PATCH Murali Karicheri 1 participant 2 messages Jul 30, 2015 – Aug 20, 2015 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Murali Karicheri

author Acked-by
#1 lore raw
In reply to a message not in the archive
Quoted 18 lines · Nicholas Krause

This fixes error checking in the function gbe_open by checking if the function netcp_register_txhook has failed by returning a error code and if so jump to the goto label fail for handling internal failures in this function.

---
  drivers/net/ethernet/ti/netcp_ethss.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/netcp_ethss.c +0 -0
index 9b7e0a3..e81e66b 100644
@@ -2257,8 +2257,10 @@ static int gbe_open(void *intf_priv, struct net_device *ndev)
  	if (ret)
  		goto fail;

drivers/net/ethernet/ti/netcp_ethss.c static int gbe_open(void *intf_priv, struct net_device *ndev) · line 2266

Quoted 10 lines
drivers/net/ethernet/ti/netcp_ethss.c +4 -2
 
-	netcp_register_txhook(netcp, GBE_TXHOOK_ORDER, gbe_tx_hook,
-			      gbe_intf);
+	ret = netcp_register_txhook(netcp, GBE_TXHOOK_ORDER, gbe_tx_hook,
+				    gbe_intf);
+	if (ret)
+		goto fail;
 
  	slave->open = true;
  	netcp_ethss_update_link_state(gbe_dev, slave, ndev);
Signature · 2 lines
Murali Karicheri
Linux Kernel, Keystone
#3 lore raw
In reply to a message not in the archive
Quoted 34 lines · nick
Quoted 26 lines · Murali Karicheri
Quoted 25 lines · Nicholas Krause

This fixes error checking in the function gbe_open by checking if the function netcp_register_txhook has failed by returning a error code and if so jump to the goto label fail for handling internal failures in this function.

---
   drivers/net/ethernet/ti/netcp_ethss.c | 6 ++++--
   1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/netcp_ethss.c +4 -2
index 9b7e0a3..e81e66b 100644
@@ -2257,8 +2257,10 @@ static int gbe_open(void *intf_priv, struct net_device *ndev)
       if (ret)
           goto fail;
 
-    netcp_register_txhook(netcp, GBE_TXHOOK_ORDER, gbe_tx_hook,
-                  gbe_intf);
+    ret = netcp_register_txhook(netcp, GBE_TXHOOK_ORDER, gbe_tx_hook,
+                    gbe_intf);
+    if (ret)
+        goto fail;
 
Quoted 5 lines

drivers/net/ethernet/ti/netcp_ethss.c static int gbe_open(void *intf_priv, struct net_device *ndev) · line 2266

Quoted 3 lines
drivers/net/ethernet/ti/netcp_ethss.c +0 -0
       slave->open = true;
       netcp_ethss_update_link_state(gbe_dev, slave, ndev);
Quoted 6 lines

Murali,
I was wondering if this patch is being merged as I haven't seen in move into David's network tree with the merged of your driver's tree.
Nick

Nick,

Not sure what else I need to do to get it applied to net repo.

David,

Can this be applied to net/master ?

Thanks

Signature · 2 lines
Murali Karicheri
Linux Kernel, Keystone