From patchwork Sun Nov 1 23:27:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 7532751 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF96C9F327 for ; Sun, 1 Nov 2015 23:27:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0737920630 for ; Sun, 1 Nov 2015 23:27:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C4332062C for ; Sun, 1 Nov 2015 23:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753312AbbKAX1n (ORCPT ); Sun, 1 Nov 2015 18:27:43 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33181 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753087AbbKAX1n (ORCPT ); Sun, 1 Nov 2015 18:27:43 -0500 Received: by wmeg8 with SMTP id g8so46245293wme.0 for ; Sun, 01 Nov 2015 15:27:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev_mellanox_co_il.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=6fZ9DFSkBl19cXzrJSgDpDGPhmz2pv4U2debvY6DcEU=; b=hjiASdrHMqAt1fa1bvj/5+VK1KHdfJoDHL/ooRVk1sNp4yWVzzXdTB9qV496SmaGr4 yoMvILr1cPEWRg6ixWBvuHayv2MsniaPrjchhoBDEJZaCj1pAXBLA1pc0lHniuvEH9Sp bBpVtdKangItxSpqK8uk/YKR0h56fK6haVqWOAJF4gkneYhy+/n13goyxjkTYQ01adb7 au4v6jW+CkGZ4y+sFply1A3eNPSys+NozgQzaKp58cdw28WAezHqA3vV0UNB6KUx1n6D WSDiaZ3jWtXcLEoke1yZjY9nXMbVvQ8YnDP99xmHhuWyn6RKC+Y5BMAbjzv8B7wQHlmO zxYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=6fZ9DFSkBl19cXzrJSgDpDGPhmz2pv4U2debvY6DcEU=; b=CnWVJsf35MyQOdJ9ll/+0OA5sgjtG6Jkg4MZAD6jA2zktH0R9byuq8JXy1CxFVcHos 5mnD9uRv5240g3KC0zgLgiqllCITh26GnL01iu3uQMvhZKZaaB4D+VSe14wIgSOhWvub qAWjGCMeXpkB+3t65ITR1xO30wpEivG6nn69P+wQbaArkvsgwcO9QuXYRdJ2xc9uzKtm Ov9BIVCR+vlpfrq+rWMVeg4wboguL+poyZsPuaHk/NjQXKPuNkMkj5hzL5gzGfQKSUDt LxqycbytwVy5cZgJm52cMxEyKyfNhu7BLZjRzkL45bsvDPrqMjQCIG34eympGkn1I7se r4Hw== X-Gm-Message-State: ALoCoQlKJIoCdlnmTtzpe6RHLh9UBZoEcwHN/+pmw5iAHfVOev2PRzRWuMh3K1t1tvrH5RqbtJ/m X-Received: by 10.28.175.208 with SMTP id y199mr10736266wme.24.1446420461729; Sun, 01 Nov 2015 15:27:41 -0800 (PST) Received: from [10.70.1.163] (bzq-218-90-50.red.bezeqint.net. [81.218.90.50]) by smtp.googlemail.com with ESMTPSA id vr10sm19138651wjc.38.2015.11.01.15.27.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Nov 2015 15:27:41 -0800 (PST) To: "Hefty, Sean" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH libibcm] cmpost.c: Handle ibv_get_device_list returning no IB devices in init() Message-ID: <56369FEE.7060100@dev.mellanox.co.il> Date: Mon, 2 Nov 2015 01:27:42 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Also, print message when init fails Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/examples/cmpost.c b/examples/cmpost.c index 1b0edf8..f7833f5 100644 --- a/examples/cmpost.c +++ b/examples/cmpost.c @@ -447,6 +447,8 @@ static int init(void) test.disconnects_left = connections; dev_list = ibv_get_device_list(NULL); + if (!dev_list) + return -1; test.device = dev_list[0]; if (!test.device) return -1; @@ -756,8 +758,10 @@ int main(int argc, char **argv) } is_server = (argc == 1); - if (init()) + if (init()) { + printf("init failed\n"); exit(1); + } if (is_server) run_server();