From patchwork Mon Jun 5 08:12:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 9765713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E7441602B6 for ; Mon, 5 Jun 2017 08:13:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D858C274D1 for ; Mon, 5 Jun 2017 08:13:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD33A27E71; Mon, 5 Jun 2017 08:13:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6888F274D1 for ; Mon, 5 Jun 2017 08:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751395AbdFEIND (ORCPT ); Mon, 5 Jun 2017 04:13:03 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:17193 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751380AbdFEIND (ORCPT ); Mon, 5 Jun 2017 04:13:03 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v558CrEV025211 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Jun 2017 08:12:54 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v558CrI5006900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Jun 2017 08:12:53 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v558CqEL006318; Mon, 5 Jun 2017 08:12:53 GMT Received: from localhost.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Jun 2017 01:12:52 -0700 From: Yuval Shaia To: monis@mellanox.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org, leon@kernel.org, yuval.shaia@oracle.com Subject: [PATCH 2/2] IB/rxe: Protect call to get_link_ksettings with rtnl lock Date: Mon, 5 Jun 2017 11:12:41 +0300 Message-Id: <20170605081241.17920-3-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170605081241.17920-1-yuval.shaia@oracle.com> References: <20170605081241.17920-1-yuval.shaia@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function __ethtool_get_link_ksettings requieres rtnl lock. Signed-off-by: Yuval Shaia --- drivers/infiniband/sw/rxe/rxe_verbs.c | 2 ++ 1 file changed, 2 insertions(+) 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;