From patchwork Sat Sep 17 00:41:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9336883 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 BFF616077F for ; Sat, 17 Sep 2016 00:41:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B685A2A2CF for ; Sat, 17 Sep 2016 00:41:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAAFC2A2DA; Sat, 17 Sep 2016 00:41:54 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 2623A2A2CF for ; Sat, 17 Sep 2016 00:41:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753821AbcIQAlq (ORCPT ); Fri, 16 Sep 2016 20:41:46 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:32775 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752001AbcIQAlq (ORCPT ); Fri, 16 Sep 2016 20:41:46 -0400 Received: by mail-pf0-f196.google.com with SMTP id q2so1548400pfj.0 for ; Fri, 16 Sep 2016 17:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Y4A7hy/KMRzsxV4cd5iwAxFPf3vFSbY9TtlLtq5kPO8=; b=AQn3TtmSeHFiueMfNsP18ENGOmtQ4SE1d+GL0bRodTZPMJdPEXa0wa/xAMlt1unyD6 eHAHTWKYziDZOn2dxQgKrzy1LUduha+mDvNkrGn8nKj3j1OWg6St7RnE2gdYMAjZFSd8 wBuGux2MOQm0PWGcK/dj273Nqafai5/Yvgdta+DFClU/UHEa+QsJXO2UEKSvqjbemNjp OITjAlr96S42O4hFQ34P3Fv5Rj3Xtq9XTKe11G/UGF0utae/lJqY+SuUuma/OdOhe1vL F+zQ/CchugfQm6d9EWA5OutWHCHy4+utWpQjSj0ggUIZ4iHxLKF3nRftyvRtoyWEwnoO tZgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Y4A7hy/KMRzsxV4cd5iwAxFPf3vFSbY9TtlLtq5kPO8=; b=CVq34bTG2DnrNqPELexHxYrp8DskWkWBd5D36kjzk+nGPzov9YI87YwxI7UnO5Pu/M WxoK3POH5St69pgaYd7jvlBhi48bS1xDbCYr1w6/cEBnzxEllBS08oiOBCn5yW+PbKLt 9FDQJmFaZmSS92OWYdIQiZ+tOfmtzVcfPWQwxqjmJ4thZ1oCv3G/UPyuMTYk55kXQECD lrmH0Kjl1icVVaSJr5hzTrJPh8hne8Ny5WST27DTxtHijFtxpeXxXTud3X+fSwN/PHKF JmYqSey5vXbsUhiTR5ylDeT2nL68aY7rfEAVARbZ2nmnx9vDB2quLynem4VvUZQvRa4n fLPQ== X-Gm-Message-State: AE9vXwPF5JK9OkUtyoQrQ71LAiacP10LW80XoAFaVGH6492tmonmIlhlXnlVMrk0t0/mkA== X-Received: by 10.98.51.131 with SMTP id z125mr27361007pfz.109.1474072905170; Fri, 16 Sep 2016 17:41:45 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id y201sm25672617pfb.13.2016.09.16.17.41.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Sep 2016 17:41:44 -0700 (PDT) From: Wei Yongjun To: Steve Wise , Doug Ledford , Sean Hefty , Hal Rosenstock Cc: Wei Yongjun , linux-rdma@vger.kernel.org Subject: [PATCH] iw_cxgb4: Fix error return code in c4iw_rdev_open() Date: Sat, 17 Sep 2016 00:41:37 +0000 Message-Id: <1474072897-30502-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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 From: Wei Yongjun Fix to return error code -ENOMEM from the __get_free_page() error handling case instead of 0, as done elsewhere in this function. Fixes: 05eb23893c2c ("cxgb4/iw_cxgb4: Doorbell Drop Avoidance Bug Fixes") Signed-off-by: Wei Yongjun Acked-by: Steve Wise --- drivers/infiniband/hw/cxgb4/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 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/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index 3c4b212..3f7f869 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c @@ -828,8 +828,10 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) } rdev->status_page = (struct t4_dev_status_page *) __get_free_page(GFP_KERNEL); - if (!rdev->status_page) + if (!rdev->status_page) { + err = -ENOMEM; goto destroy_ocqp_pool; + } rdev->status_page->qp_start = rdev->lldi.vr->qp.start; rdev->status_page->qp_size = rdev->lldi.vr->qp.size; rdev->status_page->cq_start = rdev->lldi.vr->cq.start;