From patchwork Mon Jul 29 23:54:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2835189 X-Patchwork-Delegate: roland@digitalvampire.org Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0FD3AC0319 for ; Mon, 29 Jul 2013 23:54:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3964A2012F for ; Mon, 29 Jul 2013 23:54:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D2C4201DD for ; Mon, 29 Jul 2013 23:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751710Ab3G2Xy2 (ORCPT ); Mon, 29 Jul 2013 19:54:28 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:40984 "EHLO mail-bk0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268Ab3G2Xy1 (ORCPT ); Mon, 29 Jul 2013 19:54:27 -0400 Received: by mail-bk0-f41.google.com with SMTP id jc10so667542bkc.0 for ; Mon, 29 Jul 2013 16:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=gS1qYCLuDls8cZC6V7L82jwQwP7RjlDIiVmGA+U42O8=; b=o8n50umfSzntxG+OegJitJfuGJz9EQA/X9g792zFr8lwSmA/hN3+5PL/mnOM11v/BL 5KfZ04szppuAoKCJEqNejLSg6abhYXAqfBfCxyRmPGohpEe66NZLlbrk+SwFCzqIpV4F LlJKTAUdOWFg7O+DGmDRJ0eUn4l1+ZYJHN7Dqd2k0cydruCyBs9Lh4cHuSnIi/Y6zqje HD7BEjAmjXJJ8OEKzgWhMguD7XIclmvZKItlOe3Kmo5Ho7yYR6x8c9d7oFMndgerqz3y AoCGlwG8GjOChZ7kwQOd9HoucuwEvG96l7boJnYWvxQL71EpM8CoCp+9Muz5rRjgJ1FI odKw== MIME-Version: 1.0 X-Received: by 10.204.190.10 with SMTP id dg10mr4079746bkb.56.1375142066279; Mon, 29 Jul 2013 16:54:26 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Mon, 29 Jul 2013 16:54:26 -0700 (PDT) Date: Tue, 30 Jul 2013 07:54:26 +0800 Message-ID: Subject: [PATCH] IB/mlx5: fix error return code in init_one() From: Wei Yongjun To: eli@mellanox.com, roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com Cc: yongjun_wei@trendmicro.com.cn, linux-rdma@vger.kernel.org Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/infiniband/hw/mlx5/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 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/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 8000fff..0b3e29d 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1426,7 +1426,8 @@ static int init_one(struct pci_dev *pdev, if (err) goto err_eqs; - if (ib_register_device(&dev->ib_dev, NULL)) + err = ib_register_device(&dev->ib_dev, NULL); + if (err) goto err_rsrc; err = create_umr_res(dev); @@ -1434,8 +1435,9 @@ static int init_one(struct pci_dev *pdev, goto err_dev; for (i = 0; i < ARRAY_SIZE(mlx5_class_attributes); i++) { - if (device_create_file(&dev->ib_dev.dev, - mlx5_class_attributes[i])) + err = device_create_file(&dev->ib_dev.dev, + mlx5_class_attributes[i]); + if (err) goto err_umrc; }