From patchwork Tue Nov 7 08:43:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 10045907 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 2E82460360 for ; Tue, 7 Nov 2017 08:43:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 202AF2A091 for ; Tue, 7 Nov 2017 08:43:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 152822A0B0; Tue, 7 Nov 2017 08:43:41 +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 A0C832A091 for ; Tue, 7 Nov 2017 08:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933660AbdKGInh (ORCPT ); Tue, 7 Nov 2017 03:43:37 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:16823 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933665AbdKGIne (ORCPT ); Tue, 7 Nov 2017 03:43:34 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vA78hU0Q020351 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2017 08:43:31 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vA78hUI3027225 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2017 08:43:30 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vA78hTqY025155; Tue, 7 Nov 2017 08:43:29 GMT Received: from localhost.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 07 Nov 2017 00:43:29 -0800 From: Yuval Shaia To: sean.hefty@intel.com, hal@dev.mellanox.co.il, linux-rdma@vger.kernel.org Cc: Yuval Shaia Subject: [rdma-core] librdmacm: Make return value from ucma_init consist Date: Tue, 7 Nov 2017 10:43:21 +0200 Message-Id: <20171107084321.6396-1-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.13.6 X-Source-IP: userv0022.oracle.com [156.151.31.74] 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 When check_abi_version fails we must be consist with rest of exit flows of the function and return -1 and set errno with the actual error code. Signed-off-by: Yuval Shaia --- librdmacm/cma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/librdmacm/cma.c b/librdmacm/cma.c index 7aaf45f2..4898c348 100644 --- a/librdmacm/cma.c +++ b/librdmacm/cma.c @@ -202,8 +202,10 @@ int ucma_init(void) fastlock_init(&idm_lock); ret = check_abi_version(); - if (ret) + if (ret) { + ret = ERR(EPERM); goto err1; + } dev_list = ibv_get_device_list(&dev_cnt); if (!dev_list) {