From patchwork Mon Jul 29 23:57:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2835190 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 0729CC0319 for ; Mon, 29 Jul 2013 23:57:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33D4520274 for ; Mon, 29 Jul 2013 23:57:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54602201F0 for ; Mon, 29 Jul 2013 23:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751310Ab3G2X5J (ORCPT ); Mon, 29 Jul 2013 19:57:09 -0400 Received: from mail-bk0-f49.google.com ([209.85.214.49]:62919 "EHLO mail-bk0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751153Ab3G2X5I (ORCPT ); Mon, 29 Jul 2013 19:57:08 -0400 Received: by mail-bk0-f49.google.com with SMTP id r7so1823345bkg.22 for ; Mon, 29 Jul 2013 16:57:06 -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=IHrm4BibLAnMslLV6Awdr2v+rf7QWozmg/KYLa5eg3k=; b=kcow3tA0VBZIWhFRz++Jl7f3rUI5c39oJtxAOlf1/R2zEv9H2KNXv8ZBgN/jfW5bF+ MI4aFU/1MEf1tyiuvBOklz4k1CDcLX0SvEKZkK+m2NzHJvmJ4LMpVYB/cb5owUiA5N19 OZOzh5hMkzk+Xuc+9scRRumEPWqVqibwkWBqRecpNi0j0wNTyX/I+vu5EJrhOU0wXg8f xpQ/oPKoziUknLPIvhn+pfpW70s/oDKHnodbgon2fMiH8OzdYwohq/UoNvNl8TZg22Ur Rtj+xDi5FBzI2TO4JKQEwNVL3DywRi6xX+/aDqd5nO+vIV4ilOpzhh8YjEw6T4dAJHRJ PXdg== MIME-Version: 1.0 X-Received: by 10.204.232.207 with SMTP id jv15mr3869425bkb.39.1375142226496; Mon, 29 Jul 2013 16:57:06 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Mon, 29 Jul 2013 16:57:06 -0700 (PDT) Date: Tue, 30 Jul 2013 07:57:06 +0800 Message-ID: Subject: [PATCH] mlx5: fix error return code in mlx5_alloc_uuars() From: Wei Yongjun To: eli@mellanox.com Cc: yongjun_wei@trendmicro.com.cn, netdev@vger.kernel.org, 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 -ENOMEM from the ioremap error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/net/ethernet/mellanox/mlx5/core/uar.c | 1 + 1 file changed, 1 insertion(+) -- 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/net/ethernet/mellanox/mlx5/core/uar.c b/drivers/net/ethernet/mellanox/mlx5/core/uar.c index 71d4a39..68f5d9c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c @@ -164,6 +164,7 @@ int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari) uuari->uars[i].map = ioremap(addr, PAGE_SIZE); if (!uuari->uars[i].map) { mlx5_cmd_free_uar(dev, uuari->uars[i].index); + err = -ENOMEM; goto out_count; } mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n",