From patchwork Thu Jul 13 22:46:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Govindarajulu Varadarajan (gvaradar)" X-Patchwork-Id: 9839691 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 7293C602BD for ; Thu, 13 Jul 2017 22:56:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DDA020265 for ; Thu, 13 Jul 2017 22:56:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80D7227F97; Thu, 13 Jul 2017 22:56:02 +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=-14.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL 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 6378520265 for ; Thu, 13 Jul 2017 22:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752569AbdGMWz7 (ORCPT ); Thu, 13 Jul 2017 18:55:59 -0400 Received: from alln-iport-8.cisco.com ([173.37.142.95]:62152 "EHLO alln-iport-8.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751271AbdGMWz7 (ORCPT ); Thu, 13 Jul 2017 18:55:59 -0400 X-Greylist: delayed 566 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Jul 2017 18:55:59 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1361; q=dns/txt; s=iport; t=1499986559; x=1501196159; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=Jth8uC+jLw9b5TZ0xT3lAhYqQuYtNzO4ClDId5MJ+aM=; b=O0FXhOYx6E/qKSbVqdtFUD+wVbpD+F+6p/kN6i3Kk3hdC47SXa6CJC1N hGGHwQxxTyVm2NTFCQ9U07SW2wOLwi16jWRqrOw13V3dNaFSxj+jEhJ9N /p60OUW25wWyIhUTQZIww8Tc3M15tG7tC0WOS5simNuFcb7OTgclbwzQo 4=; X-IronPort-AV: E=Sophos;i="5.40,356,1496102400"; d="scan'208";a="455024208" Received: from rcdn-core-11.cisco.com ([173.37.93.147]) by alln-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jul 2017 22:46:36 +0000 Received: from cisco.cisco.com ([10.157.132.175]) (authenticated bits=0) by rcdn-core-11.cisco.com (8.14.5/8.14.5) with ESMTP id v6DMkRnZ025600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 13 Jul 2017 22:46:35 GMT From: Govindarajulu Varadarajan To: linux-rdma@vger.kernel.org, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com Cc: benve@cisco.com, Govindarajulu Varadarajan Subject: [PATCH 2/2] usnic: do not ignore return value of __ethtool_get_link_ksettings Date: Thu, 13 Jul 2017 15:46:25 -0700 Message-Id: <20170713224625.6022-2-gvaradar@cisco.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170713224625.6022-1-gvaradar@cisco.com> References: <20170713224625.6022-1-gvaradar@cisco.com> X-Authenticated-User: gvaradar@cisco.com 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 Do not ignore the return value of the caller. Signed-off-by: Govindarajulu Varadarajan --- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c index 03002bac93e7..c0b82a990bc9 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c @@ -327,13 +327,16 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port, { struct usnic_ib_dev *us_ibdev = to_usdev(ibdev); struct ethtool_link_ksettings cmd; + int err = 0; usnic_dbg("\n"); mutex_lock(&us_ibdev->usdev_lock); rtnl_lock(); - __ethtool_get_link_ksettings(us_ibdev->netdev, &cmd); + err = __ethtool_get_link_ksettings(us_ibdev->netdev, &cmd); rtnl_unlock(); + if (err) + goto out; /* props being zeroed by the caller, avoid zeroing it here */ props->lid = 0; @@ -364,9 +367,10 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port, /* Userspace will adjust for hdrs */ props->max_msg_sz = us_ibdev->ufdev->mtu; props->max_vl_num = 1; +out: mutex_unlock(&us_ibdev->usdev_lock); - return 0; + return err; } int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,