diff mbox

[2/2] IB/rxe: Protect call to get_link_ksettings with rtnl lock

Message ID 20170605081241.17920-3-yuval.shaia@oracle.com (mailing list archive)
State Superseded
Headers show

Commit Message

Yuval Shaia June 5, 2017, 8:12 a.m. UTC
The function __ethtool_get_link_ksettings requieres rtnl lock.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 drivers/infiniband/sw/rxe/rxe_verbs.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index ffd3888..af02478 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -97,7 +97,9 @@  static int rxe_query_port(struct ib_device *dev,
 	if (rxe->ndev->ethtool_ops->get_link_ksettings) {
 		struct ethtool_link_ksettings ks;
 
+		rtnl_lock();
 		rc = rxe->ndev->ethtool_ops->get_link_ksettings(rxe->ndev, &ks);
+		rtnl_unlock();
 		speed = ks.base.speed;
 	} else if (rxe->ndev->ethtool_ops->get_settings) {
 		struct ethtool_cmd cmd;