Skip to contentSkip to conversation

sunvnet: Add missing rcu_read_unlock() in vnet_start_xmit

PATCH In review Sowmini Varadhan 1 participant 1 message Nov 9, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 sunvnet: Add missing rcu_read_unlock() in vnet_start_xmit

The out_dropped label will only do rcu_read_unlock for non-null port. So add the missing rcu_read_unlock() when bailing due to non-null port.

---
 drivers/net/ethernet/sun/sunvnet.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/sun/sunvnet.c +3 -1
index 826b385..55d66c9 100644
@@ -981,8 +981,10 @@ static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	rcu_read_lock();
 	port = __tx_port_find(vp, skb);
-	if (unlikely(!port))
+	if (unlikely(!port)) {
+		rcu_read_unlock();
 		goto out_dropped;
+	}
 
 	if (skb->len > port->rmtu) {
 		unsigned long localmtu = port->rmtu - ETH_HLEN;
Signature · 1 line
1.8.4.2