Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2c0d8df authored by Ron Mercer's avatar Ron Mercer Committed by David S. Miller
Browse files

qlge: Protect reset recovery with rtnl_lock().



Move the call to rtnl_lock() to before the internal call to
ql_adapter_down()/ql_adapter_up().  This prevents collisions that can
happen when recovering from an asic error.

Signed-off-by: default avatarRon Mercer <ron.mercer@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06a49f72
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3703,7 +3703,7 @@ static void ql_asic_reset_work(struct work_struct *work)
	struct ql_adapter *qdev =
	    container_of(work, struct ql_adapter, asic_reset_work.work);
	int status;

	rtnl_lock();
	status = ql_adapter_down(qdev);
	if (status)
		goto error;
@@ -3711,12 +3711,12 @@ static void ql_asic_reset_work(struct work_struct *work)
	status = ql_adapter_up(qdev);
	if (status)
		goto error;

	rtnl_unlock();
	return;
error:
	QPRINTK(qdev, IFUP, ALERT,
		"Driver up/down cycle failed, closing device\n");
	rtnl_lock();

	set_bit(QL_ADAPTER_UP, &qdev->flags);
	dev_close(qdev->ndev);
	rtnl_unlock();