提交 e057590b 编写于 作者: K Konstantin Khlebnikov 提交者: David S. Miller

drivers/net: enic: release rtnl_lock on error-path

enic_change_mtu_work() must call rtnl_unlock() on all exiting paths.
Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Christian Benvenuti <benve@cisco.com>
Cc: Roopa Prabhu <roprabhu@cisco.com>
Cc: Neel Patel <neepatel@cisco.com>
Cc: Nishank Trivedi <nistrive@cisco.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dd7633ec
...@@ -1761,6 +1761,7 @@ static void enic_change_mtu_work(struct work_struct *work) ...@@ -1761,6 +1761,7 @@ static void enic_change_mtu_work(struct work_struct *work)
enic_synchronize_irqs(enic); enic_synchronize_irqs(enic);
err = vnic_rq_disable(&enic->rq[0]); err = vnic_rq_disable(&enic->rq[0]);
if (err) { if (err) {
rtnl_unlock();
netdev_err(netdev, "Unable to disable RQ.\n"); netdev_err(netdev, "Unable to disable RQ.\n");
return; return;
} }
...@@ -1773,6 +1774,7 @@ static void enic_change_mtu_work(struct work_struct *work) ...@@ -1773,6 +1774,7 @@ static void enic_change_mtu_work(struct work_struct *work)
vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf); vnic_rq_fill(&enic->rq[0], enic_rq_alloc_buf);
/* Need at least one buffer on ring to get going */ /* Need at least one buffer on ring to get going */
if (vnic_rq_desc_used(&enic->rq[0]) == 0) { if (vnic_rq_desc_used(&enic->rq[0]) == 0) {
rtnl_unlock();
netdev_err(netdev, "Unable to alloc receive buffers.\n"); netdev_err(netdev, "Unable to alloc receive buffers.\n");
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册