From patchwork Thu Jul 20 18:23:40 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: 9855575 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 0B8D5601C8 for ; Thu, 20 Jul 2017 18:33:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0004C28817 for ; Thu, 20 Jul 2017 18:33:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6EF42881C; Thu, 20 Jul 2017 18:33:24 +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 0CE2C28817 for ; Thu, 20 Jul 2017 18:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935985AbdGTSdW (ORCPT ); Thu, 20 Jul 2017 14:33:22 -0400 Received: from rcdn-iport-5.cisco.com ([173.37.86.76]:15001 "EHLO rcdn-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935863AbdGTSdV (ORCPT ); Thu, 20 Jul 2017 14:33:21 -0400 X-Greylist: delayed 562 seconds by postgrey-1.27 at vger.kernel.org; Thu, 20 Jul 2017 14:33:21 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1414; q=dns/txt; s=iport; t=1500575601; x=1501785201; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=k+GxX1ZrEq+Cf6F9x1hHeU4KKJ/l8HM9sBne6xRwS94=; b=Hx6PttxpoDensEHv7FJIiJ7r9Xb7XFQF9BMP4hxSiAcCI7VMoiZuwCjO lJuaaSKgwjsJFjUI1r2EWZe1p9RaT3rTZieRh8zihVGJmjxkhXcRK+YPz uSbqQBiIYqjoivHk3WXcQ3P4cQKp5wAhGkH6tT5SXNi5AmZv1OVcISuTb U=; X-IronPort-AV: E=Sophos;i="5.40,384,1496102400"; d="scan'208";a="54546520" Received: from alln-core-3.cisco.com ([173.36.13.136]) by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jul 2017 18:23:59 +0000 Received: from cisco.cisco.com ([10.157.132.143]) (authenticated bits=0) by alln-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id v6KINq4D004144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Jul 2017 18:23:58 GMT From: Govindarajulu Varadarajan To: leon@kernel.org, linux-rdma@vger.kernel.org, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, benve@cisco.com Cc: Govindarajulu Varadarajan Subject: [PATCH v2 2/2] usnic: do not ignore return value of __ethtool_get_link_ksettings Date: Thu, 20 Jul 2017 11:23:40 -0700 Message-Id: <20170720182340.28864-2-gvaradar@cisco.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170720182340.28864-1-gvaradar@cisco.com> References: <20170720182340.28864-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 --- v2: Do not initialize err as it is over written later 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..f7be74740b3f 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; 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,