From patchwork Wed Aug 10 15:45:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9274373 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 5E4716022E for ; Thu, 11 Aug 2016 00:45:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 482A428400 for ; Thu, 11 Aug 2016 00:45:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3750A2840F; Thu, 11 Aug 2016 00:45:39 +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,FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 E34D728400 for ; Thu, 11 Aug 2016 00:45:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932203AbcHKApd (ORCPT ); Wed, 10 Aug 2016 20:45:33 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:55790 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932207AbcHKApV convert rfc822-to-8bit (ORCPT ); Wed, 10 Aug 2016 20:45:21 -0400 X-Greylist: delayed 14403 seconds by postgrey-1.27 at vger.kernel.org; Wed, 10 Aug 2016 20:45:21 EDT Received: from localhost.localdomain ([92.140.156.102]) by mwinf5d71 with ME id VTl51t00E2Cq4Kg03Tl5gl; Wed, 10 Aug 2016 17:45:09 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 10 Aug 2016 17:45:09 +0200 X-ME-IP: 92.140.156.102 From: Christophe JAILLET To: benve@cisco.com, dgoodell@cisco.com, dledford@redhat.com, sean.hefty@intel.com Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] IB/usnic: Fix error return code Date: Wed, 10 Aug 2016 17:45:01 +0200 Message-Id: <1470843901-16506-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Antivirus: avast! (VPS 160810-0, 10/08/2016), Outbound message X-Antivirus-Status: Clean 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 If 'pci_register_driver' fails, we return 'err' which is known to be 0. Return the error instead. Signed-off-by: Christophe JAILLET --- drivers/infiniband/hw/usnic/usnic_ib_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic/usnic_ib_main.c index c229b9f4a52d..0a89a955550b 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_main.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_main.c @@ -664,7 +664,8 @@ static int __init usnic_ib_init(void) return err; } - if (pci_register_driver(&usnic_ib_pci_driver)) { + err = pci_register_driver(&usnic_ib_pci_driver); + if (err) { usnic_err("Unable to register with PCI\n"); goto out_umem_fini; }